Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello everyone,
how can I calculate a % variation from previous period that is dynamic in function of the selected date granularity?
Many Thanks,
Roberto
Solved! Go to Solution.
Hi, your questions is quite ambigous. If you want to work with time intelligence, the first thing you need to know is that you need a Date Table containing one row for each day. Here you can find scripts to build one: https://blog.ladataweb.com.ar/post/185012464051/data-modeling-como-hago-una-tabla-fecha
After you relate the data from that table to the date on your table you can build this calculation like this:
Measure = CALCULATE ( Aggregation ( Table[Column] ) , DATEADD ( DateTable[DateColumn] , -N , Period) )
Where period is year, month or day; -N is the number to go back in period; and "Aggregation" is sum, average, count, etc.
Hope this helps,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Happy to help!
Hi, your questions is quite ambigous. If you want to work with time intelligence, the first thing you need to know is that you need a Date Table containing one row for each day. Here you can find scripts to build one: https://blog.ladataweb.com.ar/post/185012464051/data-modeling-como-hago-una-tabla-fecha
After you relate the data from that table to the date on your table you can build this calculation like this:
Measure = CALCULATE ( Aggregation ( Table[Column] ) , DATEADD ( DateTable[DateColumn] , -N , Period) )
Where period is year, month or day; -N is the number to go back in period; and "Aggregation" is sum, average, count, etc.
Hope this helps,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Happy to help!
User | Count |
---|---|
22 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
25 | |
13 | |
11 | |
9 | |
6 |