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
Dear All,
let's say I have created 4 measures called M1,M2,M3,M4.
Each measure is the SUMX of a different column on the same table.
What I need is to have the possibility to choose from a slicer which measures (from M1 to M4) include or exclude from the calculation into another measure (e.g. "TOTAL") that contains the dynamic SUM of the selected ones.
e.g.
If I select M1, M2 and M4, from the slicer, TOTAL would be the sum of M1+M2+M4.
Any help or any idea please!!!!!!!!!!
Solved! Go to Solution.
Hi @Anonymous ,
We can use the following steps to meet your requirement.
Measure =
SUMX(
VALUES('Table (2)'[Row]),
SWITCH(
'Table (2)'[Row],
"M1",[M1],
"M2",[M2],
"M3",[M3],
"M4",[M4])
)
We can get the result like this,
If it doesn’t meet your requirement, could you please show the exact expected result based on the table that we have shared?
BTW, pbix as attached.
Best regards,
Hi there,
I'm trying to do something similar, except for the options I have in the slicer are months. And there continue to be new months added as time passes. In the suggested switch function, is there a way to make the slicer options dynamic, as opposed to manually entering in each slicer option?
Thank you very much for your help!
Hi @Anonymous ,
We can use the following steps to meet your requirement.
Measure =
SUMX(
VALUES('Table (2)'[Row]),
SWITCH(
'Table (2)'[Row],
"M1",[M1],
"M2",[M2],
"M3",[M3],
"M4",[M4])
)
We can get the result like this,
If it doesn’t meet your requirement, could you please show the exact expected result based on the table that we have shared?
BTW, pbix as attached.
Best regards,
Hello everyone!
I have a problem that I hope can be solved.
I have 4 products (P), and with each of them I have created 2 measures.
1- Euros (€)
2- Units. (you)
If I have 8 measures P1 €,P2€,P3€,P4€ and P1ud,P2ud,P3ud,P4ud.
I would create a segmentation with two options one for € and one for you.
So when I filter by € bring me to a table or matrix the values of the 4 products in 4 columns.
Thanks a lot!!
Thank you very much! That was exactly what I needed! 🙂
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 |
---|---|
134 | |
91 | |
89 | |
64 | |
58 |
User | Count |
---|---|
201 | |
137 | |
107 | |
72 | |
68 |