Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be 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

Reply
Anonymous
Not applicable

How to select multiple measures from a list and sum the selected ones into another measure

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!!!!!!!!!!

1 ACCEPTED SOLUTION
v-lid-msft
Community Support
Community Support

Hi @Anonymous ,

 

We can use the following steps to meet your requirement.

  1. We can create a new table that contains measures’ name.
 

 

  1. Then we can create a measure like this,
Measure = 
SUMX(
    VALUES('Table (2)'[Row]),
    SWITCH(
        'Table (2)'[Row],
        "M1",[M1],
        "M2",[M2],
        "M3",[M3],
        "M4",[M4])
)

 

  1. At last we create a slicer using the new table’s column, and put the measure in a card

We can get the result like this,

 

 

 

34.png35.png36.png

 

 

 

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,

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

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!

v-lid-msft
Community Support
Community Support

Hi @Anonymous ,

 

We can use the following steps to meet your requirement.

  1. We can create a new table that contains measures’ name.
 

 

  1. Then we can create a measure like this,
Measure = 
SUMX(
    VALUES('Table (2)'[Row]),
    SWITCH(
        'Table (2)'[Row],
        "M1",[M1],
        "M2",[M2],
        "M3",[M3],
        "M4",[M4])
)

 

  1. At last we create a slicer using the new table’s column, and put the measure in a card

We can get the result like this,

 

 

 

34.png35.png36.png

 

 

 

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,

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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!!

Anonymous
Not applicable

Thank you very much! That was exactly what I needed! 🙂

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.