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
Wichi
Regular Visitor

Dynamic subtraction for a measure with multiple filters

Hi all & Happy weekend 

 

I am looking for the correct way in DAX to have a measure written, which substracts the displayed values based on multiple filters. I posted the picture below and essentially I can have various filters (e.g. material, date, bucket, country,..) which are influencing the displayed value of my measure.

Now I would like to create a measure which substracts the displayed values in the buckets. 

For Example; Salesweek 202328, MSU Germany, I would like to know the result of  substracting Bucket "1" - Bucket "2"; in numbers 

151,858,04 - 208,192,09

 

 

dynamic difference.PNG

 

Many Thanks!

2 REPLIES 2
Wichi
Regular Visitor

Hi ! 

 

I do understand the point around the sample data, yet currently it is not possible for me to provide a sample dataset at this point. I was thinking to get a more generic idea on how to approach this (e.g. with summarize?)

 

So I put the tables below, does that help ?

 

Ingoing position

BPCL5MSUDescBucketComponentLevel1Sum of ComponentForecastSalesWeek
Germany1Promo151.858202328
Germany1Promo159.275202329
Germany1Promo250.468202330
Germany1Promo307.138202331
Germany1Promo242.284202332
Germany2Promo208.192202328
Germany2Promo122.548202329
Germany2Promo175.637202330
Germany2Promo279.969202331
Germany2Promo214.924202332

 

The desired outcome as below as addition 

 

BPCL5MSUDescBucketComponentLevel1Sum of ComponentForecastSalesWeek
Germany1Promo151.858202328
Germany1Promo159.275202329
Germany1Promo250.468202330
Germany1Promo307.138202331
Germany1Promo242.284202332
Germany2Promo208.192202328
Germany2Promo122.548202329
Germany2Promo175.637202330
Germany2Promo279.969202331
Germany2Promo214.924202332
GermanyDiff 1-2Promo-56.334202328
GermanyDiff 1-2Promo36.727202329
GermanyDiff 1-2Promo74.831202330
GermanyDiff 1-2Promo27.169202331
GermanyDiff 1-2Promo27.360202332
Ritaf1983
Super User
Super User

Hi @Wichi 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

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.