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
Hi All,
I am using a switch function to sum up values in a Power BI matrix, but the hierarchy is not rolling up as I expected it to. I am using a switch function to flip between the value I want for France and the values for the rest of countries.
Here is my DAX:
Solved! Go to Solution.
Hi @mf2499pbi
Thanks for reaching out to us.
please try the measures below
Measure = SWITCH(SELECTEDVALUE('Table'[Column1]),"FRANCE",sum('Table'[amount1])/1000, sum('Table'[amount2] )/1000)TEST = IF(HASONEFILTER('Table'[Column1]),[Measure],SUMX('Table',[Measure]))
then put measure [TEST] into matrix,
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
Hi @mf2499pbi
Thanks for reaching out to us.
please try the measures below
Measure = SWITCH(SELECTEDVALUE('Table'[Column1]),"FRANCE",sum('Table'[amount1])/1000, sum('Table'[amount2] )/1000)TEST = IF(HASONEFILTER('Table'[Column1]),[Measure],SUMX('Table',[Measure]))
then put measure [TEST] into matrix,
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
@mf2499pbi , Try like
Test Rollup =
Sumx(Values(('Hierarchy'[level2] ) , calculate(switch(SELECTEDVALUE('Hierarchy'[level2]), "FRANCE", sum('Table'[Amount1])/1000, sum('Table'[Amount2] )/1000)) ))
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!
| User | Count |
|---|---|
| 9 | |
| 7 | |
| 6 | |
| 6 | |
| 5 |
| User | Count |
|---|---|
| 24 | |
| 21 | |
| 18 | |
| 14 | |
| 13 |