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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.