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

Previousday DAX measure in matrix

Hi Community,

 

I have tried to figure out how to get my measure to show the previousday sales for a specific customer.

I have used this: 

INV YDA = CALCULATE(SUM(Fact_Invoiced[TTL_EUR_AMOUNT]);PREVIOUSDAY(Dim_Calendar[Date]))
 
It works fine when I am using it in a table. There I can see it is showing the correct results.
My problem occur when I am using the measure in a matrix. Then when I choose a specific month in a filter, it will in the matrix show the value from the 1st day of the selected month instead of the sales from the previous date in the month. 
 
Ex. Is there a way to get it to show the sales from the 4/5 instead of 1/1 in the matrix? Maybe by somehow adding a max date or something
1 REPLY 1
amitchandak
Super User
Super User

@Anonymous , this seems fine, should have worked. Try this option with your date table

example

Last Day Non Continous = CALCULATE(sum('order'[Qty]),filter(all(Table),Table[Date] =MAXX(FILTER(all(Table),Table[Date]<max(Table[Date])),Table[Date])))
Day behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd(Table[Date],-1,Day))

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.