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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
afleiderman1
Helper I
Helper I

Difference in same measure

Hi everyone I have the following problem,

I have the following problem

I have one measure where I put put my values 

sales amount

 

I have one value I in my column date for week begins 

And for my row I have one value which is customer name

So I have for example the following table

I also have emplyoeed on my row

 

 

 

Name                  employeed id        Week Begins   6/1/2023                6/7/2023             total

 

Jeff Durand                XZW4                       100                 50                                        150

 

 

Elliot Jamal                WER5                        20                     40                                      60 

 

My question is I want the difference between what was sold between 6/7 and 6/1

 

Name                   Week Begins   6/1/2023                6/7/2023        difference         total

 

Jeff Durand                                 100                         50                              -50                    150

 

 

Elliot Jamal                                  20                       60                          20                  60 

 

But I am not sure how to create this as a measure and have a table like the one above.

They both come from the same measure sales amount. 

Please help.

 

 

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@afleiderman1 , Please find the file. The file assumes that at least 2 weeks are selected. The diff calculation can work even if one week is selected, but I suppressed it.

 

amitchandak_0-1681532553226.png

 

Table

amitchandak_1-1681532577985.png

 

Measure
Measure = SWITCH(TRUE(),
Max(WOW[Column1]) ="Actual", [Net],
if(ISBLANK([This Week]) || ISBLANK([Last Week]), BLANK(), [This Week] -[Last Week]))


If needed consider an independent table when one week is selected and you want to display more than one week

Need of an Independent Date Table:https://www.youtube.com/watch?v=44fGGmg9fHI

 

View solution in original post

2 REPLIES 2
afleiderman1
Helper I
Helper I

Hi I got one more quick question what would the relation between the wow column 1 and the week begin date

I tried doing something similar but got this

afleiderman1_0-1681738960180.png

 

amitchandak
Super User
Super User

@afleiderman1 , Please find the file. The file assumes that at least 2 weeks are selected. The diff calculation can work even if one week is selected, but I suppressed it.

 

amitchandak_0-1681532553226.png

 

Table

amitchandak_1-1681532577985.png

 

Measure
Measure = SWITCH(TRUE(),
Max(WOW[Column1]) ="Actual", [Net],
if(ISBLANK([This Week]) || ISBLANK([Last Week]), BLANK(), [This Week] -[Last Week]))


If needed consider an independent table when one week is selected and you want to display more than one week

Need of an Independent Date Table:https://www.youtube.com/watch?v=44fGGmg9fHI

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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