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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
awolf88
Helper II
Helper II

Displaying Change in Value by date selection

Dearest community,

I'm sure there is a really simple way of doing this, but once again I can't seem to be figuring this out on my own:

 

I have a very simple table of Open orders by Customer: 

awolf88_0-1669368972328.png

Now I've displayed this in my PowerBI version already as I need it, but: 

the date_archived are as they say dates representing the state of the open orders by customer on that very date it was archived. So instead of summarizing it, i displayed the status of every day by adding the "Date_archived" into the column fields of my table: 

awolf88_1-1669369114910.png

Now since i have a lot of dates and dont want to display all of them, I've additionally added a slicer with multi-selection for the end-user to compare  (PLEASE NOTE HERE: I want these dates to be flexible to the user, so it's not always the last date in table versus one at random). 

awolf88_0-1669369291525.png

So one thing i was looking for was a measure i could put in place, that would show the change in Value between two selections, if that makes sense? To demonstrate, see encolored what I'd be interesed in (column D). Is there an easy way of doing this that i just can't seem to think of? 

awolf88_1-1669369809592.png

 

I've left a demo file alongside data table for your convenience here:

https://www.dropbox.com/scl/fo/i6oeb9mvrypo4bawjwov1/h?dl=0&rlkey=vgd213f2hh34sf6aki42s62l7

 

Thanks in advance!

As always, appreciate all of your efforts!


Best,

Alex

 

 

 

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

You can create a measure like

Diff = 
VAR MinDate = CALCULATE( MIN( 'OpenOrders'[date_archived]), ALLSELECTED(OpenOrders[date_archived]) )
VAR MaxDate = CALCULATE( MAX('OpenOrders'[date_archived]), ALLSELECTED(OpenOrders[date_archived] ) )
VAR StartValue = CALCULATE( 
    [total Open Orders], 
    ALLEXCEPT(OpenOrders, OpenOrders[Customer]),
    'OpenOrders'[date_archived] = MinDate
)
VAR EndValue = CALCULATE( 
    [total Open Orders], 
    ALLEXCEPT(OpenOrders, OpenOrders[Customer]),
    'OpenOrders'[date_archived] = MaxDate
)
RETURN EndValue - StartValue 

In order to get the matrix to display correctly you need to turn off word wrap for column headings and values and then set the width of the Diff column which appears under the first date to 0.

View solution in original post

2 REPLIES 2
johnt75
Super User
Super User

You can create a measure like

Diff = 
VAR MinDate = CALCULATE( MIN( 'OpenOrders'[date_archived]), ALLSELECTED(OpenOrders[date_archived]) )
VAR MaxDate = CALCULATE( MAX('OpenOrders'[date_archived]), ALLSELECTED(OpenOrders[date_archived] ) )
VAR StartValue = CALCULATE( 
    [total Open Orders], 
    ALLEXCEPT(OpenOrders, OpenOrders[Customer]),
    'OpenOrders'[date_archived] = MinDate
)
VAR EndValue = CALCULATE( 
    [total Open Orders], 
    ALLEXCEPT(OpenOrders, OpenOrders[Customer]),
    'OpenOrders'[date_archived] = MaxDate
)
RETURN EndValue - StartValue 

In order to get the matrix to display correctly you need to turn off word wrap for column headings and values and then set the width of the Diff column which appears under the first date to 0.

Wow, this works amazing!!! Thank you sooo so much for your help! 

 

Best,

Alex

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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