Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Remove filter with measure

How to filter a date and use a measure remove that previous filter? For example: If I filter January show me all itens in my table that have a January date, but if I filter February I need to see al...
  • v-yanjiang-msft's avatar
    4 years ago

    Hi Anonymous ,

    According to your description, I create a sample.

    If you want to count the number of days less than or equal to the selected month, in my sample your formula works.

    If you want to display all dates from January and February when you filter February, here's my solution.

    1. Create a new month table, don't make relationship between the two tables.

    2.Create a measure.

    Check =
    IF (
        MAX ( 'MyTable'[End Date] )
            <= MAXX (
                FILTER (
                    ALL ( 'MyTable' ),
                    FORMAT ( 'MyTable'[End Date], "MMMM" ) = SELECTEDVALUE ( 'Month'[Month] )
                ),
                'MyTable'[End Date]
            ),
        1
    )
    

    Put the new month column in a slicer and put the measure in the visual filter and select its value to 1, get the result.

    I attach my sample below for reference.

     

    Best Regards,
    Community Support Team _ kalyj

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.