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

Refer to previous value within a Matrix

Hey guys,

 

last 2 columns is my issue. I need the "Backlog Line not put away prior day" Value to calculate my SLAs. All columns values are measures. "Backlog Line not put away prior day" uses Today()-1 which is fine but with how PBI works it does not show any value for prior day as each row is displayed for one specific Date. So what i am asking is there a way to transfer my "No Putaway" (which is the same as the Backlog) from a prior Date to the next Date? And if not do you have any other ideas on how to achive this kind of matrix.

 

Unbenannt.PNG

 

2 ACCEPTED SOLUTIONS
Mariusz
Community Champion
Community Champion

Hi 
you can use the below, this should solve your problem.
 
yesterday =
VAR yd = MAX('calendar'[Date]) -1
RETURN
CALCULATE(
[measure],
ALL('calendar'), 'calendar'[Date] = yd
)

View solution in original post

@Anonymous you can simply use previousday function as mentioned previously

 

Prev Day = 
CALCULATE( [Measure], PreviousDay( Calendar[Date] ) )


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.

View solution in original post

7 REPLIES 7
Mariusz
Community Champion
Community Champion

Hi 
you can use the below, this should solve your problem.
 
yesterday =
VAR yd = MAX('calendar'[Date]) -1
RETURN
CALCULATE(
[measure],
ALL('calendar'), 'calendar'[Date] = yd
)
Anonymous
Not applicable

This is genious! Thx. Works great. I am new to PBI still got a lot to learn.

Hi @Anonymous 

If you new to Power BI and you're looking to learn DAX check out the link below.

This will give you a good strat

https://www.sqlbi.com/learn/introducing-dax-video-course/

Many thanks

Mariusz

@Anonymous you can simply use previousday function as mentioned previously

 

Prev Day = 
CALCULATE( [Measure], PreviousDay( Calendar[Date] ) )


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.

Mariusz
Community Champion
Community Champion

@parry2k  agree your solution is much simpler and the result is the same

Anonymous
Not applicable

Both works fine. Yours is shorter 🙂

parry2k
Super User
Super User

@Anonymous you can use previousday function to get the value from previous date. It is adviseable to add date dimension in your model if you already don't have one.



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.

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.