Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

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

DatesLast MonthLast 3 monthsLast 12 months
01/01/2024NONOYES
01/04/2024NONOYES
01/07/2024NOYESYES
01/10/2024YESYESYES


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/202401/09/202401/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:

Weekly Date Filter Types = {
    ("L52W", NAMEOF('LC_Calendar_Weekly'[L52W]), 0),
    ("L26W", NAMEOF('LC_Calendar_Weekly'[L26W]), 1),
    ("L16W", NAMEOF('LC_Calendar_Weekly'[L16W]), 2),
    ("L4W", NAMEOF('LC_Calendar_Weekly'[L4W]), 3),
    ("LW", NAMEOF('LC_Calendar_Weekly'[LW]), 4)
}
 
=> iso NAMEOF, would it be possible to use FILTER(('LC_Calendar_Weekly'[L26W])="YES")
 
I probably if i can create this, would need to link the parameter table to the calendar table itself. That is not an issue.

I hope someone can help, 

Thanks a lot



  • Anonymous's avatar
    Anonymous
    2 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

  • Anonymous's avatar
    Anonymous
    Not applicable

    For now I solved it by adding multiple slicers to my page where the user can choose one he wants and SELECT it

  • _AAndrade's avatar
    _AAndrade
    Resident 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.
    • Anonymous's avatar
      Anonymous
      Not 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