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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Orstenpowers
Post Patron
Post Patron

Quick Measure to be adjusted

Good Morning!

 

WIth the help of a quick measure I created a YoY% comparison, but unfortunately I am too stupid to adjust this measure in order to get the difference in absolute values instead of relative values.

 

The measure is as follows:

AmountEUR YoY% =
IF(
    ISFILTERED('Kalender'[Date]),
    ERROR("Quickmeasures mit Zeitintelligenz können nur über die von Power BI bereitgestellte Datumshierarchie oder die primäre Datumsspalte gruppiert oder gefiltert werden."),
    VAR __PREV_YEAR =
        CALCULATE(
            SUM('Data'[AmountEUR]),
            DATEADD('Kalender'[Date].[Date], -1, YEAR)
        )
    RETURN
        DIVIDE(SUM('Data'[AmountEUR]) - __PREV_YEAR, __PREV_YEAR)
)
 
What do I need to change???

Hopefully someone out there can help me!?

Best regards
Torsten
1 ACCEPTED SOLUTION

hi @Orstenpowers 

aha, then please try:

AmountEUR YoY% =
IF(
    ISFILTERED('Kalender'[Date]),
    ERROR("Quickmeasures mit Zeitintelligenz können nur über die von Power BI bereitgestellte Datumshierarchie oder die primäre Datumsspalte gruppiert oder gefiltert werden."),
    VAR __PREV_YEAR =
        CALCULATE(
            SUM('Data'[AmountEUR]),
            DATEADD('Kalender'[Date].[Date], -1YEAR)
        )
    RETURN
        SUM('Data'[AmountEUR]) - __PREV_YEAR
)

View solution in original post

4 REPLIES 4
FreemanZ
Super User
Super User

hi @Orstenpowers 

are you expecting something like this:

AmountEUR YoY% =
IF(
    ISFILTERED('Kalender'[Date]),
    ERROR("Quickmeasures mit Zeitintelligenz können nur über die von Power BI bereitgestellte Datumshierarchie oder die primäre Datumsspalte gruppiert oder gefiltert werden."),
    VAR __PREV_YEAR =
        CALCULATE(
            SUM('Data'[AmountEUR]),
            DATEADD('Kalender'[Date].[Date], -1YEAR)
        )
    RETURN
        ABS DIVIDE(SUM('Data'[AmountEUR]) - __PREV_YEAR__PREV_YEAR) )
)

@FreemanZ,

 

Thanks for your prompt support!

Unfortunately this was not the result I was looking for, but I suppose my request was too vague. 

 

Unbenannt.JPG

Taking this screenshot as an example, I need a measure bringing the result € 23.625, so the difference betweeen 2022 and 2021.

 

Most likely very easy for you...

hi @Orstenpowers 

aha, then please try:

AmountEUR YoY% =
IF(
    ISFILTERED('Kalender'[Date]),
    ERROR("Quickmeasures mit Zeitintelligenz können nur über die von Power BI bereitgestellte Datumshierarchie oder die primäre Datumsspalte gruppiert oder gefiltert werden."),
    VAR __PREV_YEAR =
        CALCULATE(
            SUM('Data'[AmountEUR]),
            DATEADD('Kalender'[Date].[Date], -1YEAR)
        )
    RETURN
        SUM('Data'[AmountEUR]) - __PREV_YEAR
)

@FreemanZ :

PERFECT FIT! Thank you very much!

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.