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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
nicolast29
Helper V
Helper V

matrix total

Hi

 

I use Switch in a matrix, because i love switch 😀 and it avoid me to use the filters panel

 

But i don't understand how to calculate my total at the bottom ....

Thanks for explaination, that i can use to solve my case

 

here my file

https://1drv.ms/u/s!AoqtZHsX4BzvhIB1Mul5moH-QFilNw?e=Iz3Xkc

 

Nicolas

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

I am not sure which measure you want to fix, but if you want to fix the [Group I] measure, please try the below.

 

GROUPE I =
SUMX (
    VALUES ( 'fusion Balances Ts Dos'[Affectation] ),
    CALCULATE (
        SWITCH (
            TRUE (),
            SELECTEDVALUE ( 'fusion Balances Ts Dos'[Affectation] ) = "Achats", [Achats],
            SELECTEDVALUE ( 'fusion Balances Ts Dos'[Affectation] ) = "Autres Prestations", [Autres Prestations],
            SELECTEDVALUE ( 'fusion Balances Ts Dos'[Affectation] ) = "Déplacements, missions et réceptions", [Déplacements, missions et réceptions],
            SELECTEDVALUE ( 'fusion Balances Ts Dos'[Affectation] ) = "Frais postaux et frais de télécommunications", [Frais postaux et frais de télécommunications]
        )
    )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

2 REPLIES 2
nicolast29
Helper V
Helper V

Thanks a lot

Sorry yes it was the good mesure

 

It works 

I will now working on your solution to understand !!

 

Have a nice day

Jihwan_Kim
Super User
Super User

Hi,

I am not sure which measure you want to fix, but if you want to fix the [Group I] measure, please try the below.

 

GROUPE I =
SUMX (
    VALUES ( 'fusion Balances Ts Dos'[Affectation] ),
    CALCULATE (
        SWITCH (
            TRUE (),
            SELECTEDVALUE ( 'fusion Balances Ts Dos'[Affectation] ) = "Achats", [Achats],
            SELECTEDVALUE ( 'fusion Balances Ts Dos'[Affectation] ) = "Autres Prestations", [Autres Prestations],
            SELECTEDVALUE ( 'fusion Balances Ts Dos'[Affectation] ) = "Déplacements, missions et réceptions", [Déplacements, missions et réceptions],
            SELECTEDVALUE ( 'fusion Balances Ts Dos'[Affectation] ) = "Frais postaux et frais de télécommunications", [Frais postaux et frais de télécommunications]
        )
    )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.