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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Anonymous
Not applicable

Need help with a dynamic percent change based on selected slicers

I need to calculate the percent change between two values based on the selected slicers. I have 4 years of data on my graph (see below), and I'd like to calculate the percent change in price based on the below example. 
This is what my graph currently looks like along with the two slicers. 

VNHAREL26_1-1702067238679.png

 

I want to be able to select a year and then two months and get a percent change for the two prices, For example, the below would be a -6% change from October to April. 

VNHAREL26_2-1702067332772.png

Below is what I came up with, but haven't been able to make it work. Any input would be greatly appreciated:

% Change ASP_Historical =
 DIVIDE(
    CALCULATE(
        'Historical Sales'[ASP],
        FIRSTDATE('DATETABLE'[Date])),
        CALCULATE(
            'Historical Sales'[ASP],
            LASTDATE('DATETABLE'[Date]))
            -1)
1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@Anonymous 

Try this measure please:

% Change ASP_Historical = 
VAR __MinDateValue = 
    CALCULATE(
        [ASP],
        FORMAT('DATETABLE'[Date],"mmyy") = FORMAT(MIN('DATETABLE'[Date]),"mmyy"),
        ALLSELECTED( 'DATETABLE' )
    )
VAR __MaxDateValue = 
    CALCULATE(
        [ASP],
        FORMAT('DATETABLE'[Date],"mmyy") = FORMAT(Max('DATETABLE'[Date]),"mmyy"),
        ALLSELECTED( 'DATETABLE' )
    )
RETURN
    DIVIDE( __MaxDateValue - __MinDateValue , __MinDateValue )
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

2 REPLIES 2
Fowmy
Super User
Super User

@Anonymous 

Try this measure please:

% Change ASP_Historical = 
VAR __MinDateValue = 
    CALCULATE(
        [ASP],
        FORMAT('DATETABLE'[Date],"mmyy") = FORMAT(MIN('DATETABLE'[Date]),"mmyy"),
        ALLSELECTED( 'DATETABLE' )
    )
VAR __MaxDateValue = 
    CALCULATE(
        [ASP],
        FORMAT('DATETABLE'[Date],"mmyy") = FORMAT(Max('DATETABLE'[Date]),"mmyy"),
        ALLSELECTED( 'DATETABLE' )
    )
RETURN
    DIVIDE( __MaxDateValue - __MinDateValue , __MinDateValue )
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

This worked perfectly, thank you!

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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