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.
Hello,
I'm trying to create a measure to apply a filter for the dates around a selected date in a date table ('Date Table') based on a selected date in the filter.
Functionally i would like to have it as either a 1 or a 0 to apply the filter on if the date is +/- 3 days on either side of the slicer. So if the chosen date is Jan 10, 2020, i would like the measure to be 1 for Jan 7, 2020 to Jan 13, 2020, and all other dates in the table to be 0. In the base case of no selection i would probably just want it to be a 1 if possible. My hope is to have this as a measure within the 'Date Table' so i can just pop this into other pages as required.
Any suggestions? I can get the selected value with SELECTEDVALUE, but its the application of the 1/0 thats got me stumped for the measure side.
thanks!
@cody_s think you need to date table, the table on slicer should have not relationship, then put one in the slicer, another one in your visual, like this
@cody_s , Try a measure like
new measure =
var _max = maxx(allselected('Date'),'Date'[Date])+3
var _min = maxx(allselected('Date'),'Date'[Date])-3
return
calculate( sum(Table[Value]), filter(all(Date),'Date'[Date] >=_min && 'Date'[Date] <=_max))
Thats not quite the solution that i'm thinking of. I'm thinking of a measure thats either 1 or 0 so i can apply it as a filter on my table as an "equals 1"
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
49 | |
26 | |
21 | |
15 | |
12 |
User | Count |
---|---|
57 | |
49 | |
44 | |
19 | |
18 |