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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
TealSA
Frequent Visitor

How to calculate price change using a constant price that changes on slicer date

Hi! Looking for a solution. Here is the scenario:

1. I have a date slicer, upon selection it gives me the price of my product. 

2. I get the price that is associated with the Min Date on the slicer 

3. I use that price to calculate the price change for all the products with the date.

 something like (Curr Price - Base Price)/ Base Price. 

4. What I am doing is : Get the basedate = CALCULATE( MIN('mytable'[Datecol]),ALLSELECTED('mytable'))

Get the base price : CALCULATEMAX(MyTable[ProdPrice]), FILTER(MyTable, Mytable[DateCol]    = BaseDt)

But I see Base Price only for BaseDate Month, instead I want to see that constant price for all the months after that BaseDt till 06/2023. But it is blank.  Any help here?

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @TealSA ,

You can create a calendar table separately and have no relationship to the primary table

 

Here are the steps you can follow:

1. Create calculated table.

Table2 =
CALENDAR(
    DATE(2023,3,1),DATE(2023,12,31))

vyangliumsft_0-1688437059355.png

2. Create measure.

Want to see this instead =
var _mindate=
MINX(ALLSELECTED('Table2'),[Date1])
return
SUMX(
    FILTER(ALL('Table'),
    'Table'[MyDateField]=_mindate),[Happening])
Difference Column =
MAX('Table'[Happening]) - [Want to see this instead]

3. Result:

vyangliumsft_1-1688437059367.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi  @TealSA ,

You can create a calendar table separately and have no relationship to the primary table

 

Here are the steps you can follow:

1. Create calculated table.

Table2 =
CALENDAR(
    DATE(2023,3,1),DATE(2023,12,31))

vyangliumsft_0-1688437059355.png

2. Create measure.

Want to see this instead =
var _mindate=
MINX(ALLSELECTED('Table2'),[Date1])
return
SUMX(
    FILTER(ALL('Table'),
    'Table'[MyDateField]=_mindate),[Happening])
Difference Column =
MAX('Table'[Happening]) - [Want to see this instead]

3. Result:

vyangliumsft_1-1688437059367.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

TealSA
Frequent Visitor

 HI , I am looking to get this to happen:

Thank you for your help!

 

TealSA_2-1687540238537.png

 

 

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

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.