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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

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
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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