March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hey,
I'm trying to create one measure, that will return other measures based on another unrelated 'Measure' table, that I will use as a column in a Matrix. The below DAX expression does the trick, but its SO slow. I think its calculating every measure, rather than just the selected few. Anyone got any ideas around this at all? I've tried using IF(), and i've tried using SWITCH(TRUE(),"Actual",[Actual]........). I can't find a way around it, but it's a real necessity for the users to be able to filter between the different measures as they need
I had an issue with something similiar and was able to get away with this via structure formatting of the visuals. If you were to split the variances into separate visuals next to each other you'd experience much better performance I'd imagine. I attached a screenshot of my example with very long switch statements with complex modeling in the underlying measures used in the swith. This entire page takes ~10 seconds to load.
So something like:
Or you can elect to section based on
Either way, I think you can improve performance via thinking about your formatting.
Hi @Anonymous ,
Az38' suggestion is great. In addition, you may improve the performance of measures used in your SWITCH formula, such as [Actual], [Forecast], [Budget],,,etc.
For example:
Use SELECTEDVALUE() instead of VALUES()
Use ISBLANK() instead of =Blank() check
Do not use scalar variables in SUMMARIZE()
Use variables instead of repeating measures inside the IF branch
You may refer to the tips:
Improve Power BI Performance by Optimizing DAX
A comprehensive guide to Power BI performance tuning
Best Regards,
Amy
Community Support Team _ Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks for the feedback. Unfortunately I've already optimised the source measures and don't think I can speed them up much more. The real issue is with the consolidation of the measures in the switch
Hi @Anonymous
try step 2 and step 3 in this https://community.powerbi.com/t5/Community-Blog/Performance-Tuning-DAX-Part-1/ba-p/976275 workaround by @Greg_Deckler
Thanks for your reply! I've spent a good while trying to apply this to my Dax and can't figure it out. Step 2 relies on the number of entries in a table but mine is an unlinked table with one instance of each in the table. Step 3 I don't really see how I can apply it either. If you can give any guidance on how I could specifically apply them to my situation id really appreciate any help
@Anonymous do you know if this is the switch is slow or the measures used in switch are slow, what happens if you use these measures directly, and see if these measures are not performing as expected.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
The measures are taking just short of 5 seconds each to load per performance analyser. If I have 4 measures filtered in the measure table, i was expecting about 20 seconds max for the table. Instead its taking 80/90 seconds to load this single switch measure, with no other visuals or measures on the page. Googling it, it seems that switch does perform this way, and calculates every measure regardless of its use - just wondering if anyone had any ideas at all on alternative solutions
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
123 | |
85 | |
85 | |
70 | |
51 |
User | Count |
---|---|
205 | |
153 | |
97 | |
79 | |
69 |