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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Previous Day Value Calculation

Hi,

I am trying to do two things here:

 

  1. ascertain the change in AttatchmnetRate% (this is a calculated measure) over the previous day
  2. If this change is more than negative -2% over the previous day format the cell to show red

Help_PowerBI_0-1665465133224.png

 

So for EG:

the attatchement rate % change should show me -0.36% on October 5 (66.07 - 65.71)

then the attatchement rate % chagne should show me  -2.56% on October 6 ( 65.71 -63.15)

 

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @Anonymous 

 

You can try the following methods.

AttatchmnetRate%  is a calculated measure.

Previous day% = CALCULATE([AttatchmnetRate%],FILTER(ALL('Table'),[Date]=SELECTEDVALUE('Table'[Date])-1))
Change = IF([Previous day%]<>BLANK(),[AttatchmnetRate%]-[Previous day%])
Color = IF([Change]<=-0.02,"Red")

vzhangti_0-1665566721616.pngvzhangti_1-1665566731101.png

Result:

vzhangti_2-1665566760189.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

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

3 REPLIES 3
v-zhangti
Community Support
Community Support

Hi, @Anonymous 

 

You can try the following methods.

AttatchmnetRate%  is a calculated measure.

Previous day% = CALCULATE([AttatchmnetRate%],FILTER(ALL('Table'),[Date]=SELECTEDVALUE('Table'[Date])-1))
Change = IF([Previous day%]<>BLANK(),[AttatchmnetRate%]-[Previous day%])
Color = IF([Change]<=-0.02,"Red")

vzhangti_0-1665566721616.pngvzhangti_1-1665566731101.png

Result:

vzhangti_2-1665566760189.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

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

Anonymous
Not applicable

thanks... explained in an easy step by step manner and easy to understand.. 

amitchandak
Super User
Super User

@Anonymous , With help from date table, You can try measures like examples 

 

This Day = CALCULATE(sum('Table'[Qty]))

This Day = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Date]=max('Date'[Date])))


Last Day = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Date]=max('Date'[Date])-1))
Last Day = CALCULATE(sum('Table'[Qty]), previousday('Date'[Date]))

 

diff =[This Day] - [Last Day]

 

Why Time Intelligence Fails - Powerbi 5 Savior Steps for TI :https://youtu.be/OBf0rjpp5Hw
https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5bd4
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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 MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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