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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
krixtsup3r
Helper V
Helper V

Field Parameters Difference Total

Hi All, just asking for help on how can I create a Total but instead of sum it should be difference of the two selected measure in the Field Parameters. See below and attached sample PBI file on how it looks like:

krixtsup3r_0-1685591839143.png

Here is the download link for the sample pbix file: https://www.dropbox.com/s/6qrb5seyty1d2l4/sample.pbix?dl=0

 

Thank you so much for the help!

 

1 ACCEPTED SOLUTION

@krixtsup3r 
You need to hide the non total [Difference] column(s) manually.

1.png

View solution in original post

6 REPLIES 6
olgad
Super User
Super User

Hi, not sure if this is possible, the top most what i could achieve is something like that

olgad_0-1685605166608.png

you just create a switch measure =

SwitchMeasure = SWITCH(min('Right Table'[Right Table Order]),
0, [2 Revenue],
1, [2 Cost],
2, [2 Gross])
Every  measure with 1 you have to remake like this: 
1 Cost = if(isfiltered(test_data[Month]), SUM(test_data[Cost]), SUM(test_data[Cost])-[SwitchMeasure])
Every Measure with 2. 
if(isfiltered(test_data[Month]), SUM(test_data[Revenue]))

Afterwards depending on your data may be you can play how to hide that column in the end. 

DID I ANSWER YOUR QUESTION? PLEASE MARK MY POST AS A SOLUTION! APPRECIATE YOUR KUDO/LIKE!
PROUD TO BE A SUPER USER!
Best Stories, Interesting Cases: PowerBI Storytime Newsletter
Linkedin Profile: Linkedin
YouTube Channel: PowerBI Storytime

Thank you @olgad 

tamerj1
Super User
Super User

Hi @krixtsup3r 
Please refer to attached sample file with the proposed solution.

1.png

Thank you @tamerj1!

 

Also, what if I selected more than 2 months in it? What it should do actually is add the 3 months for both parameters and then do the difference.

The output should be like this:

krixtsup3r_0-1685606339120.png

 

@krixtsup3r 
You need to hide the non total [Difference] column(s) manually.

1.png

Awesome this works! Thank you!

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.