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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.