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.
Hi,
I have a table with columns for Date Contract and Date Deliver as in the example below:
Date Contract | Date Deliver | ID |
1/09/2019 | 1 | |
5/10/2019 | 2 | |
9/10/2019 | 27/10/2019 | 3 |
1/11/2019 | 1/11/2019 | 4 |
1/12/2019 | 5/12/2019 | 5 |
I want to able able create a MonthYear slicer and when I select a month, eg Oct2019, to have another slicer for Date Contract that will display only the date values for Oct2019and before(1/09/2019,5/10/2019 and 9/10/2019) and another slicer for Date Deliver taht will display date values for Oct and after(27/10/2019/01/11/2019/05/12/2019).
I can't figure out the dax formula for it, I've tried to cerate a measure with if an selectedvalue but no luck so far.
Thanks!
Solved! Go to Solution.
Take a look at the attached file.
Generally you are going to want to have atleast 1 completly unrelated calendar table that you will use as a slicing table. This is going to act as the source for the plain Year/month slicer.
The idea is to use 2 different measure, like the ones in my demo file to get the selected date/yearmonth and then use that as a visual level filter on the other two slicers.
Take a look and let me know how it goes!
Br,
J
Take a look at the attached file.
Generally you are going to want to have atleast 1 completly unrelated calendar table that you will use as a slicing table. This is going to act as the source for the plain Year/month slicer.
The idea is to use 2 different measure, like the ones in my demo file to get the selected date/yearmonth and then use that as a visual level filter on the other two slicers.
Take a look and let me know how it goes!
Br,
J
it's working, thanks.
I just updated a litle bit the formula for over, to take in consideration also teh dates for the selected month when using a filter YearMonth
Thanks
@salexa , Create an independent date slicer and use that in measure
Measure 2 =
var _max = maxx(allselected('Date') , 'Date'[Date])
var _min = minx(allselected('Date') , 'Date'[Date])
return
calculate(countrows('Table'), Filter(all('Table'), 'Date'[Date Contract] <=_max && 'Date'[Date Deliver] >=_min ))
or
Measure =
var _max = maxx(allselected('Date') , 'Date'[Date])
var _min = minx(allselected('Date') , 'Date'[Date])
return
calculate(countrows('Table'), Filter(all('Table'), 'Date'[Date Contract] <=_max ))
Measure 1=
var _max = maxx(allselected('Date') , 'Date'[Date])
var _min = minx(allselected('Date') , 'Date'[Date])
return
calculate(countrows('Table'), Filter(all('Table'), 'Date'[Date Deliver] >=_min ))
Just making sure i understadn the requirement.
You want 3 slicers.
One plain Year/Month.
One slicing contract date. Showing the selected month and every date before that.
One slicing delivery date. Showing the selected month and every date after that.
Am i correct?
/ J
yes, you've summed up correctly my need
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 |
---|---|
107 | |
100 | |
80 | |
63 | |
58 |
User | Count |
---|---|
148 | |
111 | |
94 | |
84 | |
67 |