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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
Anonymous
Not applicable

Calculate change with dynamic dates

Hi everyone,

 

I want to calculate the change in customers in percentage based on a changeable period. So the measure should look like this:

([Number of customers], max_date - [Number of customers], min_date)/[Number of customers], min_date

 

For example:

Max_date      Number of customers    Min_date      Number of customers   Measure_outcome

7-2020                      1000                    12-2019               1200                         (1000-1200)/1200=16,67%

5-2020                       800                      9-2019                  600                         (800-600)/600=33,33%

 

Could someone help me with this? 

1 ACCEPTED SOLUTION
dax
Community Support
Community Support

Hi @Anonymous , 

You could refer to my sample for details.

Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

6 REPLIES 6
parry2k
Super User
Super User

@Anonymous I guess this is not how your raw data looks like, solution can be very different based on how your data is shaped, so share sample data the way you have it in your mode and then we can provide a solution.

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.



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.

Anonymous
Not applicable

Hi @parry2k ,

 

Of course!

I made a sample set of two columns > Month and year and Customers.

 

The link is as follows:

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

 

 

dax
Community Support
Community Support

Hi @Anonymous , 

Yes, I saw your sample, but in your sample, which part is max date? Which part is min date? If possible, could you please inform me in details? By the way, you also could rfere to my sample for details.

Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Hi @dax ,

 

Thank you for your reply.

The max and min date should be dynamic. 

For example, by default, the min dat is January, 2018 and the max date is April 2020. If you add a date slicer, and you select only Janary and February 2020, than those two months are the min and max date. 

So, by default, the result should be (6742-6085)/6085=10,8%

And for Jan en Feb 2020, it should be (6395-6345)/6345=0,8%

dax
Community Support
Community Support

Hi @Anonymous , 

You could refer to my sample for details.

Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Anonymous
Not applicable

Thank you! This was exactly what I was looking for.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors