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 one fact table and one date dimension table. There is a report with one page with many visuals and one slicer to select the month. Some visuals should be filtered to the selected month, others to the past 6 months, others to the past 12 months. How can I handle this without changing the requirement which was provided to me? My solution thus far has been to disconnect the date table and use measures for all values, so that I can provide the filter context inside each measure. Any more elegant solutions would be much appreciated. Thank you.
Solved! Go to Solution.
Hi @Anonymous ,
According to your description, I create this data:
Here are the steps you can follow:
1. Create date table.
Date = CALENDARAUTO()
2. Create calculated column.
Month = MONTH('Table'[date])
Month = MONTH('Date'[Date])
3. Create measure.
When slicer selects a date, a visual object displays the selected month:
Flag1 =
var _selectedmonth=SELECTEDVALUE('Date'[Month])
return
IF(
MAX('Table'[Month])=_selectedmonth,1,0)
Put it in filters and set is = 1
When slicer selects date, a visual object displays the first 6 months of selection:
Flag2 =
var _selectedmonth=SELECTEDVALUE('Date'[Month])
return
IF(
MAX('Table'[Month])=_selectedmonth-6,1,0)
Put it in filters and set is = 1
4. Result
You can downloaded PBIX file from here.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
According to your description, I create this data:
Here are the steps you can follow:
1. Create date table.
Date = CALENDARAUTO()
2. Create calculated column.
Month = MONTH('Table'[date])
Month = MONTH('Date'[Date])
3. Create measure.
When slicer selects a date, a visual object displays the selected month:
Flag1 =
var _selectedmonth=SELECTEDVALUE('Date'[Month])
return
IF(
MAX('Table'[Month])=_selectedmonth,1,0)
Put it in filters and set is = 1
When slicer selects date, a visual object displays the first 6 months of selection:
Flag2 =
var _selectedmonth=SELECTEDVALUE('Date'[Month])
return
IF(
MAX('Table'[Month])=_selectedmonth-6,1,0)
Put it in filters and set is = 1
4. Result
You can downloaded PBIX file from here.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous , if the relative date slicer is not working, then you have to use disconnected tables only.
Same what is also done here
https://www.youtube.com/watch?v=duMSovyosXE
or
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 |
---|---|
114 | |
99 | |
82 | |
70 | |
60 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |