Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

measure that shows YOY difference that excludes future dates

I'm trying to write a measure that filters out future values when compairing YOY difference, and I was able to do this.  However, when I use that measure against customer, my total is correct by at the custome level the calcuation is not correct.  How do I modify my measure so that I the difference can be calculated across different columns and be correct?  Thank you.

diff YOY amount = SUMX(
SUMMARIZE('calendar','calendar'[Year],'calendar'[Month Name],"ABCD",
if(ISBLANK([revneue]),
BLANK(),
[revneue]-[revenue ly])),
[ABCD])

 

https://drive.google.com/file/d/11iIHWdMjnCOGJOmBBiIjFH2ljTKJ6vN3/view?usp=sharing

 

  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi Anonymous,

    In fact, measure expressions are calculated based on their row contents. You can't direct calculated through different measure expressions that calculate based on their own category groups.

    For this scenario, you can try to create a variable with summarize function to manually restore their category group and correspond row content for keeping raw calculation results. Then you can do aggerate and calculate between these variables.

    All the secrets of SUMMARIZE - SQLBI
    Regards,
    Xiaoxin Sheng

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous,

    In fact, measure expressions are calculated based on their row contents. You can't direct calculated through different measure expressions that calculate based on their own category groups.

    For this scenario, you can try to create a variable with summarize function to manually restore their category group and correspond row content for keeping raw calculation results. Then you can do aggerate and calculate between these variables.

    All the secrets of SUMMARIZE - SQLBI
    Regards,
    Xiaoxin Sheng