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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Pfoster
Helper I
Helper I

Deltas within a Measure (?)

Hello all,

again, I need help because I am totally lost:
Screenshot 2025-05-13 142002.png

with the help of this forum, I was able to create this chart, and there is now only missing, to show the deltas between the periods (-15% between 2020 and 2021 i.e.). 
But I do not have an idea, how to calculate it, because to be able to create that chart, I have the values in one measure:

YaQ_Volume =
SWITCH(
    SELECTEDVALUE('Unrelated Date'[Category]),
    "Year",CALCULATE([SalesFinal],FILTER(VALUES(Output[Yr]),FORMAT(Output[Yr],"#")In VALUES('Unrelated Date'[Period]))),
    "Quarter",CALCULATE([SalesFinal],KEEPFILTERS(TREATAS(VALUES('Unrelated Date'[Period]),Output[QYear])),
    KEEPFILTERS(Output[Yr]=MAX(Output[Yr]))))

 

 

Is there a way to insert now also the deltas between the periods? 

Thank you for any tipp and advice. 

1 ACCEPTED SOLUTION
DataNinja777
Super User
Super User

Hi @Pfoster ,

 

To calculate the deltas between periods in your chart using the existing YaQ_Volume measure, you can create a separate DAX measure that captures the previous period’s value and computes the percentage change. Assuming your 'Unrelated Date'[Period] column contains sortable numeric values (e.g., 2020, 2021, or Q1 as 1, Q2 as 2, etc.), use the following DAX:

YaQ_Delta = 
VAR CurrentValue = [YaQ_Volume]
VAR PrevValue = 
    CALCULATE(
        [YaQ_Volume],
        FILTER(
            ALL('Unrelated Date'),
            'Unrelated Date'[Category] = MAX('Unrelated Date'[Category]) &&
            'Unrelated Date'[Period] = MAX('Unrelated Date'[Period]) - 1
        )
    )
RETURN 
IF(
    NOT ISBLANK(PrevValue),
    DIVIDE(CurrentValue - PrevValue, PrevValue),
    BLANK()
)

This measure evaluates the current value and compares it to the previous period’s value by subtracting one from the current 'Unrelated Date'[Period]. It returns the percentage difference. If the previous value is blank, the measure returns blank to avoid misleading percentages. You can then display this measure as a tooltip or data label in your visual. If your period column is not numeric, this logic will need to be adjusted using a rank or index to establish chronological order.

 

Best regards,

View solution in original post

2 REPLIES 2
v-kathullac
Community Support
Community Support

Hi @Pfoster ,

we would like to follow up to see if the solution provided by the super user resolved your issue. Please let us know if you need any further assistance.

If our super user response resolved your issue, please mark it as "Accept as solution" and click "Yes" if you found it helpful.

Regards,

Chaithanya

DataNinja777
Super User
Super User

Hi @Pfoster ,

 

To calculate the deltas between periods in your chart using the existing YaQ_Volume measure, you can create a separate DAX measure that captures the previous period’s value and computes the percentage change. Assuming your 'Unrelated Date'[Period] column contains sortable numeric values (e.g., 2020, 2021, or Q1 as 1, Q2 as 2, etc.), use the following DAX:

YaQ_Delta = 
VAR CurrentValue = [YaQ_Volume]
VAR PrevValue = 
    CALCULATE(
        [YaQ_Volume],
        FILTER(
            ALL('Unrelated Date'),
            'Unrelated Date'[Category] = MAX('Unrelated Date'[Category]) &&
            'Unrelated Date'[Period] = MAX('Unrelated Date'[Period]) - 1
        )
    )
RETURN 
IF(
    NOT ISBLANK(PrevValue),
    DIVIDE(CurrentValue - PrevValue, PrevValue),
    BLANK()
)

This measure evaluates the current value and compares it to the previous period’s value by subtracting one from the current 'Unrelated Date'[Period]. It returns the percentage difference. If the previous value is blank, the measure returns blank to avoid misleading percentages. You can then display this measure as a tooltip or data label in your visual. If your period column is not numeric, this logic will need to be adjusted using a rank or index to establish chronological order.

 

Best regards,

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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