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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

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 5
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

 

Screenshot (32).png

 

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.

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

I am running into the same problem and found this post really helpful:

http://radacad.com/previous-dynamic-period-dax-calculation

 

You can create dynamic previous period measures using DAX. 

 

However, I still think Power BI should provide this feature in the date slicer. If I have lots of measures that I want to allow my users to perfome this kind of comparisions, then I would have to create lots of previous period measures. That's too much work!

 

Here is the idea that you can vote:

https://ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/19129159-compare-to-previous-peri...

v-huizhn-msft
Employee
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

parry2k
Super User
Super User

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?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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