Whenever you can, you should avoid filtering whole tables in DAX–as opposed to columns–in DAX, because the performance may suffer, or you may get unexpected results, or both. In this blog post, we’re looking at the performance aspect. Continue reading “Power BI Antipatterns #9: Filtering whole tables, part I”
Power BI Antipatterns #8: Unformatted DAX
While unformatted DAX formulas may not affect the calculation speed, they can take a lot of time to read, and they can even hide errors just because the errors are hard to spot. Despite there being several ways to format your DAX code, I still see a lot of formulas that aren’t formatted. Continue reading “Power BI Antipatterns #8: Unformatted DAX”
Power BI Antipatterns #7: ISBLANK
If you want to return 0 instead of BLANK, do you need to check if the result is BLANK first? I’m covering this and a few related issues in this blog post. Continue reading “Power BI Antipatterns #7: ISBLANK”
Power BI Antipatterns #6: IF and VALUE
What’s VALUE in DAX used for? Do we always need IF in case you want to output 1 and 0 instead of TRUE and FALSE? That’s what this blog post is about. Continue reading “Power BI Antipatterns #6: IF and VALUE”
Power BI Antipatterns #5: CALCULATE
Do you know what CALCULATE with just one argument does? In a measure? In a calculated column? This is the topic of this blog post. Continue reading “Power BI Antipatterns #5: CALCULATE”
Power BI Antipatterns #4: YEAR + MONTH
How many ways there are to create a Year-Month column in DAX? In this blog post, I’ll show you one bad way, one OK way, one good, and one great way. Continue reading “Power BI Antipatterns #4: YEAR + MONTH”
Power BI Antipatterns #3: Table functions
Do you think Microsoft’s own files always follow best practices? Think again! In this episode, I’m dissecting a calculated table DAX formula from a system file generated automatically in Power BI service. Continue reading “Power BI Antipatterns #3: Table functions”
Power BI Antipatterns #2: SELECTEDVALUE
The pilot issue of the Power BI Antipatterns series received good feedback, and I’m back with the second blog post in the series, in which I’m going to discuss the SELECTEDVALUE function. Continue reading “Power BI Antipatterns #2: SELECTEDVALUE”
Power BI Antipatterns #1: SWITCH(TRUE… in DAX (The Pilot)
Welcome to Power BI Antipatterns, my new blog post series! Over the past few years, as I’ve been working as an independent consultant, I’ve seen many examples of practices in Power BI that were less than optimal. In other words, they weren’t best practices. What’s curious is that sometimes very different people wrote code in the same (bad) way. So I thought I’d like to dissect some of the antipatterns, and I’m starting with the misuse of the SWITCH function in DAX.
Continue reading “Power BI Antipatterns #1: SWITCH(TRUE… in DAX (The Pilot)”
SWITCH and SWITCH(TRUE… in Power Query
Ever wanted to mimic the SWITCH
function from DAX (or CASE ... WHEN
from SQL) in Power Query, including the SWITCH(TRUE...
behavior? In this blog post, I’m providing a function that does just that.