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

Change in price relative to baseline date

Hi everyone - I'm trying to normalize pricing information relative to the date slicer.  Here's what I have:

 

jctrue_0-1658713179933.png

I'd like to calculate the price at the starting date that I select from the slice, and then determine the $ change in price and the % change in price.

 

sample PBIX file

 

I tried this to calculate the Min Date: 

Start Price =
VAR MinDate = CALCULATE(MIN(Sheet2[Price Month]),ALLSELECTED())
return
CALCULATE(SUM(Sheet2[Price]),FILTER(Sheet2,Sheet2[Price Month]=MinDate))
 
But it only seems to match to date that is the same as the filter.
 
Thanks in advance!
1 ACCEPTED SOLUTION

I think I got it ,

 

Min Date = CALCULATE(MIN(Sheet2[Price Month]),FILTER(ALLEXCEPT(Sheet2,Sheet2[Product Name]),Sheet2[Price Month] in FILTERS('Slicer table'[Price Month] )))

 

baseline = CALCULATE(SUM(Sheet2[Price]),FILTER(ALLEXCEPT(Sheet2,Sheet2[Product Name]),Sheet2[Price Month]=[Min Date]))
ribisht17_0-1658861625245.png

Here is my own video on ALLEXCEPT https://youtu.be/fEIaJigVfFg , hope it helps

Regards,
Ritesh
Please mark the answer if it was helpful

View solution in original post

4 REPLIES 4
jctrue
Regular Visitor

Thanks @ribisht17 - that got me closer.. Now I can't figure out how to get the baseline price to match up to the individual products.

 

I'm sure I need to include "Product Name" somewhere in this expression to calculate the Baseline price, but I can't figure out where to put it.

 

baseline = CALCULATE(SUM(Sheet2[Price]),FILTER(ALLSELECTED(Sheet2),Sheet2[Price Month]= [mindate]))

 

Any ideas?

 

Thanks again!

I think I got it ,

 

Min Date = CALCULATE(MIN(Sheet2[Price Month]),FILTER(ALLEXCEPT(Sheet2,Sheet2[Product Name]),Sheet2[Price Month] in FILTERS('Slicer table'[Price Month] )))

 

baseline = CALCULATE(SUM(Sheet2[Price]),FILTER(ALLEXCEPT(Sheet2,Sheet2[Product Name]),Sheet2[Price Month]=[Min Date]))
ribisht17_0-1658861625245.png

Here is my own video on ALLEXCEPT https://youtu.be/fEIaJigVfFg , hope it helps

Regards,
Ritesh
Please mark the answer if it was helpful

Thank you so much!  This is exactly what I was looking for.

ribisht17
Super User
Super User

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.