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

Showing sales upto yesterdays date

Hi,

 

I have a slicer that shows sales upto todays date in earlier month (eg. today it shows what we have sold each month upto the 18th):

Current day = if(DateTable[Monthday] <= DAY(TODAY()); TRUE(); FALSE())
 
I would now like to change it to show sales upto yesterdays date. I have tried:
Yesterdays date = if(DateTable[Monthday] <= DAY(TODAY()-1); TRUE(); FALSE())
but it did not work.
 
Any ideas?
1 ACCEPTED SOLUTION

Hi @sw123

 

If Monthday=DAY(DateTable[Date]) is a measure,it should be modified as below:

 

 

Monthday=DAY(SELECTEDVALUE(DateTable[Date]))

 

If it doesnt work, pls show me your .pbix file.You can upload it to onedrive then share the link with us.

 

 

Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi, the easiest way, when your first formula works as expected, would be to replace the <= with <

 

Yesterdays date = if(DateTable[Monthday] < DAY(TODAY()); TRUE(); FALSE())

 

Thanx, but it still doesn't work. Does it have something to do with the Monthday, that is a measure in my date table:

Monthday = DAY(DateTable[Date])
 
I'm not to good with DAX...

Hi @sw123

 

If Monthday=DAY(DateTable[Date]) is a measure,it should be modified as below:

 

 

Monthday=DAY(SELECTEDVALUE(DateTable[Date]))

 

If it doesnt work, pls show me your .pbix file.You can upload it to onedrive then share the link with us.

 

 

Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!

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.