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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
m_wex
Helper I
Helper I

Selection Date Slicer

Hi Everyone,

 

Created a date slicer based on a date table linked to my invoiced sales table. The invoiced sales table only contains data through March 2021 but the slicer shows all quarters for 2021. Running into an issue with previous years' data. If Q1 is selected no issue, YTD and PYTD information is correct. But if 2021 is selected (which includes all 4 quarters) the previous years' sales data shows the whole pervious year versus only the sales through March 2021. Is there a workaround for the slicer so that it only allows selection though the last sales date in the involved sales table?

 

m_wex_0-1626230159411.png

Thanks M_Wex

2 REPLIES 2
m_wex
Helper I
Helper I

Hi Amitchandak,

 

Thank you. Should I amend the relationship? From single cross filter direction to both?

With the Dax solutions. Is it possible to only show the last invoiced sales dare from the sales table for the date slicer? What I need ultiamtely is to map the last invoice date in the sales fact table to the slicer. That end date could be any date depending on how the fact table is updated. Right now, it is updated on a monthly basis but I am trying to get the report as close to real time as possible.

 

M_Wex

 

amitchandak
Super User
Super User

@m_wex , As slicer might be coming from Date table having only one-directional join. Then Date slicer will not filter.

 

You can add measure in visual level filter for slicer and check for not blank value 

 

 

You can force QTD

 

QTD QTY forced=
var _max = today()
return
if(max('Date'[Date])<=_max, calculate(Sum('order'[Qty]),DATESQTD('Date'[Date])), blank())
//or
//calculate(Sum('order'[Qty]),DATESQTD('Date'[Date]),filter('Date','Date'[Date]<=_max))
//calculate(TOTALQTD(Sum('order'[Qty]),'Date'[Date]),filter('Date','Date'[Date]<=_max))

 

 

LQTD QTY forced=
var _max = date(year(today()),month(today())-3,day(today()))
return
if(max('Date'[Date])<=_max, CALCULATE(Sum('order'[Qty]),DATESQTD(dateadd('Date'[Date],-1,year)),'Date'[Date]<=_max), blank())
//OR
//CALCULATE(Sum('order'[Qty]),DATESQTD(dateadd('Date'[Date],-1,Quarter)),'Date'[Date]<=_max)
//TOTALQTD(Sum('order'[Qty]),dateadd('Date'[Date],-1,Quarter),'Date'[Date]<=_max)

 

or

 

LQTD QTY forced=
var _max1 = maxx('order',[Order date]) // or //maxx(allselected('Date'), 'Date'[Date]) // or // Today()
var _max = date(year(_max1),month(_max1)-3,day(_max1))
return
if(max('Date'[Date])<=_max, CALCULATE(Sum('order'[Qty]),DATESQTD(dateadd('Date'[Date],-1,Quarter)),'Date'[Date]<=_max), blank())
//OR
//CALCULATE(Sum('order'[Qty]),DATESQTD(dateadd('Date'[Date],-1,Quarter)),'Date'[Date]<=_max)
//TOTALQTD(Sum('order'[Qty]),dateadd('Date'[Date],-1,Quarter),'Date'[Date]<=_max)

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.