Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
However, it looks like I'm getting incorrect results if more than 1 statements in switch falls under a single value. In that case whichever statement comes first is the one that populates the card.
How can I change the formula to make the results accurate?
Solved! Go to Solution.
iffiltered() insted of hasonevalue() solved the issue for me
iffiltered() insted of hasonevalue() solved the issue for me
Hi @MikhailGG,
Glad your issue has been resolved!
I suggest you to accept your own post as the solution — it will help other community members facing similar problems to find the answer faster.
Regards,
Vinay Pabbu
The switch statement evaluate in sequence, so if the first statement is true, it will stop there.
If you need to evalute combinations of multiple statements, you might have to do something like this:
VAR _statement1 = HASONEVALUE('Data'[Region])
VAR _statement2 = HASONEVALUE('Data'[Country])
VAR _statement3 = HASONEVALUE('Data'[Functional Area])
SWITCH(
TRUE(),
Statement1 && Statement2 && Statement3, Result1,
Statement1 && Statement2, Result2,
Statement1, Result3,
Result4
)
That is the problem. How can I ignore the sequence if I slice by Functional Area, but the chosen functional area has only single region and since region comes before functional area in the switch statement, I get results for region instead of functional area? Is there a different approach besides switch?
Each of those tables: sales_by_region, sales_by_country and etc have slightly different values for Total. They just have different weights depending on the table.
Can you share your data model, I think you're problem is modelling maxing the DAX much more complicated than it needs to be.
Realistically you should
Then the measure would just be median( sales[offical_total] ) and you can slice and dice however you want.
Your current issue what happens if some selects filter from multiple slicers, they will likely get misleading results
this ☝️
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!