Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
9 years ago

Dynamic Previous Period Comparison

Hello friends,

I would like to build a measure that would compare Sales in a Current Period vs. Previous Period.

The catch here is I would like it to be dynamic, so when my user chooses a certain month, it will compare this month vs. previous.

When my user chooses a certain Quarter - it will compare vs. previous Quarter.

PARALLELPERIOD requires an interval value - but in my scenario - it could be either Month, Quarter, Year...

Any ideas?

Thanks!

Michael

5 Replies

  • I think it is doable, first create three measures for Previous month, quarter and year and then create one more measure which will look at what is selected (month, quarter or year), and based on that dynamically change the value of this measure. 

     

    Just to clarify, you have slicer on your report to select month, quarter or year, correct?

  • v-huizhn-msft's avatar
    v-huizhn-msft
    Microsoft Employee

    Hi Anonymous,

    Could you please post some sample data or share .pbix file to us for further analysis? Based on your description, I am not reproduce your scenario. Thanks for your understanding.

     

    Best Regards,
    Angelia

  • ElaW's avatar
    ElaW
    Regular Visitor

    I'm also experiencing a similar problem. I would like to display the data according to time X and its corresponding Previous period.
    For example by the last 3 days, and accordingly the three days preceding them.

    Suppose I show the scale between the 10th and the 13th of the month, so the previous period will be between 7 and 10.

    The solution to be dynamic. That you can determine the amount of days / months / period on which I want to calculate, and accordingly will be calculated the period preceding it

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi All ,

    I am trying to do YOY comparison .Here Period is constant for one year at each level and I am able to achieve it in one measure  in powerbi so far.It is working fine  when I do drilldown as shown below

    Period Over Period(YOY ADR Growth)
    Y->2020 Vs 2021
    M->8-2020 Vs 8-2021
    W ->31-2020 Vs 31-2021
    D->8/4-2020 Vs 8/4-2021

     

     

    The issue comes in when i am trying to achieve something like shown below as period is not constant at each level and is changing .Can we achieve it one measure like I did for YOY or not.If so how ? If not, what is the best way to show them.

    Previous Period Comparison
    Y ->2020 vs 2021
    M ->8-2021 Vs 7-2021
    W ->31-2021 Vs 30-2021
    D->8/4-2020 Vs 8/3-2021

     

    Please provide some suggestions.

     

    Thanks.