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
julesdude
Post Partisan
Post Partisan

Chart to start from 'to' date selected in the Date Slicer

Hi there,

I have a start and end date slicer at the top of my report where the from date is hidden so can't be changed by the user, and the 'to' date can be adjusted by the user so that all visuals in the the report only illustrate data within this time period and before the 'to' date.

I have two problems:

1. Trouble is I have one visual bar graph where I need it to display data starting from the 'to' date selected in the above slicer, and nothing previous to this date.. 

2. For the 'from' and 'to' date slicer I mentioned above, how do I get the report open always displaying today's date in the 'to' box of the slicer?

 

Many thanks in advance for any help!

2 REPLIES 2
amitchandak
Super User
Super User

@julesdude , Based on what I got, create a slicer on an independent date table. and then create measure based on that

 

//Date1 is independent Date table, Date is joined with Table
new measure =
var _max = Minx(allselected(Date1),Date1[Date])
return
calculate( sum(Table[Value]), filter('Date', 'Date'[Date] >=_max))

or

 

//Date1 is independent Date table
new measure =
var _max = maxx(allselected(Date1),Date1[Date])
var _min = minx(allselected(Date1),Date1[Date])
return
calculate( sum(Table[Value]), filter('Table', 'Table'[Date] >=_min && 'Table'[Date] <=_max))

 

Need of an Independent Date Table:https://www.youtube.com/watch?v=44fGGmg9fHI

Hi @amitchandak 

Many thanks for this. This is a really useful video. I've been experimenting with your examples. I'm not having much luck due to my own ignorance but I shall keep going. I attach an example here if you could take a look? It's the 'measure by year' graph. Normally it has TableB[Value] as the Y-axis but this is where I'm trying measures instead. 

 

I was wondering - if i took the following DAX to establish the end date of the date slicer:

measure = maxx(allselected(DateTable),DateTable[Date])
 
Could i not just use the ALL expression in:
calculate( sum(Table[Value]), filter('Date', 'Date'[Date] >=_max))
to
calculate( sum(TableB[Value]), Filter(ALL(TableB),'TableB'[Date] >= _max))
 
to disregard any filter already applied to dates? Actually, in theory it could work - as I try in practice it does not.
 
Any help appreciated.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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