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
jovendeluna21
Helper III
Helper III

How to create a new column/measure for daily difference from the previous day?

Hello,

Anyone can help on how to have a new column/measure that will show the difference from the previous day of "7 Day Rolling Average of Total Distribution per 100k". The challenge is, this column is a measure.

For example January 13 minus January 12 (8,550.20 - 8,035.99 = 514.21), January 14 minus January 13 (8,754.71 - 8,550.20 = 204.51) and so on..

Hopefully you can help me.

Herewith you can check my pbi file. Thanks!

https://drive.google.com/file/d/1ix2fgHbF15-5PIU9JBX3xG-apNC7yMIG/view?usp=sharing

 

7 day.JPG

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

HI @jovendeluna21 

 

Add the following measure to your calculation:

7days variation = 
[7 Day Rolling Average of Total Distribution per 100k]
    - CALCULATE (
        [7 Day Rolling Average of Total Distribution per 100k],
        FILTER (
            ALLSELECTED( us_state_vaccinations[date] ),
            us_state_vaccinations[date]
                = MAX ( us_state_vaccinations[date] ) - 1
        )
    )

 

MFelix_0-1612092315260.png

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

2 REPLIES 2
StefanoGrimaldi
Resident Rockstar
Resident Rockstar

hello ypu can use a dax as follow: 

new measure =( (calculate(sum([total distributed per 100k]), date = today()) - calculate(sum([total distributed per 100k]), date = today()-1)) +(calculate(sum([total distributed per 100k]), date = today()-1) - calculate(sum([total distributed per 100k]), date = today()-2)) + .... and so on until last today its minus 7 ) / 7

that its one option, 

a second options would be using the move to move change of quick measure and change it up a little to make it per day. adding it in a graph with the last 7 days and getting a average line in the visual. 





Did I answer your question? Mark my post as a solution! / Did it help? Give some Kudos!

Proud to be a Super User!




MFelix
Super User
Super User

HI @jovendeluna21 

 

Add the following measure to your calculation:

7days variation = 
[7 Day Rolling Average of Total Distribution per 100k]
    - CALCULATE (
        [7 Day Rolling Average of Total Distribution per 100k],
        FILTER (
            ALLSELECTED( us_state_vaccinations[date] ),
            us_state_vaccinations[date]
                = MAX ( us_state_vaccinations[date] ) - 1
        )
    )

 

MFelix_0-1612092315260.png

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



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.