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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Dinamically calculate % variation in function of selected granularity.

Hello everyone,

how can I calculate a % variation from previous period that is dynamic in function of the selected date granularity?

Many Thanks,
Roberto

 

1 ACCEPTED SOLUTION
ibarrau
Super User
Super User

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.


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

Happy to help!

LaDataWeb Blog

View solution in original post

1 REPLY 1
ibarrau
Super User
Super User

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.


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

Happy to help!

LaDataWeb Blog

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors