Forum Discussion
Slicing Calendar Table based on multiple columns condition
Hi everyone,
I have a calendar Table containing my dates and some calculated columns that allows me to easily filter by dates in DAX Measures. See table below (my dates are contiguous of course, it is just a short example) where the TODAY date would be 15/10/2024
| Dates | Last Month | Last 3 months | Last 12 months |
| 01/01/2024 | NO | NO | YES |
| 01/04/2024 | NO | NO | YES |
| 01/07/2024 | NO | YES | YES |
| 01/10/2024 | YES | YES | YES |
This allows me to basically do measures like SALES LAST 3 MONTHS = CALCULATE(Sales, filter LAST 3 Months = "YES")
Now, I would like the user to be able to use a slicer where he potentially could choose himself how to filter the sales:
So if my table would be:
| 01/08/2024 | 01/09/2024 | 01/10/2024 | |
| Product A | |||
| Product B |
The slicer would need the user to choose:
Last Month => the behaviour of the table should show only 01/10/2024
Last 3 Months => the behaviour of the table should show only 01/10/2024 - 01/09/24 - 01/08/24
and so on
But when using this in a parameter it OF COURSE does not work because the slicer only contains the column.
Is there a way in the parameter itself to add the filter condition.
Current PARAMETER:
I hope someone can help,
Thanks a lot
- Anonymous2 years ago
For now I solved it by adding multiple slicers to my page where the user can choose one he wants and SELECT it
4 Replies
- AnonymousNot applicable
For now I solved it by adding multiple slicers to my page where the user can choose one he wants and SELECT it
- _AAndradeResident Rockstar
Hi,
If I understood well, you can use parameter with all your measures for each period.
For example:
Measure_Parameter ={("Last Month", NAMEOF('Measure'[SALES LAST MONTH]), 0),("Last 3 Month", NAMEOF('Measure'[SALES LAST 3 MONTH])), 1),("Last 6 Month", NAMEOF('Measure'[SALES LAST 6 MONTH]), 2),("Last Year", NAMEOF('Measure'[SALES LAST YEAR]), 3)}
And after use a Matrix visual as you have in your example and use the parameter measure on the Values.
I think this could solve your problem. If you need any help, please let me know.- AnonymousNot applicable
Hi Andrade,
That is supposing I want only the sales. Actually whatever the measure would be in my table i would like to filter my dates.
So in essence if we imagine a matrix table where the dates are in the column.
The slicer should ONLY filter these dates.
Not sure that is clear
- _AAndradeResident Rockstar
Take a look at this blog: https://radacad.com/power-bi-from-and-to-date-filtering-with-one-slicer
See if this could solve your problem.