Forum Discussion

CJensen's avatar
CJensen
Helper I
11 months ago
Solved

Remove date filter from DAX measure

Hi everbody

 

I cant seem to get my DAX to work. I need it to not filter on any dates. But it still filters with dates on my calculation.

 

CalcExample = SUMX(VALUES('PlanningLines'[Key]),CALCULATE(SUM('PlanningLines'[LineAmount]),'PlanningLines'[Linetype] = "Billable" || 'PlanningLines'[Linetype] = "Both Budget and Billable" , 'Task No'[No] >= 2021, ALLEXCEPT('PlanningLines','PlanningLines'[Key]),REMOVEFILTERS('Date')))
  • Hi CJensen ,

    Based on your description, your DAX measure is functioning correctly for calculations it ignores the date slicer due to REMOVEFILTERS(Date). However, this only impacts the calculation, not the rows displayed in your visual.

    If your visual, such as a table or matrix, is filtered by the slicer or uses the Date field directly, it will still only display the selected month, even though the measure calculates across all dates.

    If you want to display all dates regardless of the slicer, you have a few options

    1. Remove the slicer’s interaction with the visual.
    2. Use a disconnected date table for filtering.
    3. Create a separate visual to show totals for all dates.

    I hope that’s helpful. Let me know if you need any further assistance.

     

    Regards,

    Yugandhar.

5 Replies

  • Hello CJensen 

     

    try this measure

    CalcExample =
    SUMX (
    VALUES ( 'PlanningLines'[Key] ),
    CALCULATE (
    SUM ( 'PlanningLines'[LineAmount] ),
    KEEPFILTERS (
    'PlanningLines'[Linetype] = "Billable"
    || 'PlanningLines'[Linetype] = "Both Budget and Billable"
    ),
    KEEPFILTERS ( 'Task No'[No] >= 2021 ),
    REMOVEFILTERS ( 'Date' )
    )
    )

     


    If my response helped you, please consider clicking
    Accept as Solution and giving it a Like 👍 – it helps others in the community too.


    Thanks,


    Connect with me on:

    LinkedIn

     

    • CJensen's avatar
      CJensen
      Helper I

      Hi Pankajnamekar25

      Thank you so much for trying, it seems that I cant get it to drop the dates from the slicer no matter what. Ive tried your solution and it still only includes the values from the selected month

      • V-yubandi-msft's avatar
        V-yubandi-msft
        Community Support

        Hi CJensen ,

        Based on your description, your DAX measure is functioning correctly for calculations it ignores the date slicer due to REMOVEFILTERS(Date). However, this only impacts the calculation, not the rows displayed in your visual.

        If your visual, such as a table or matrix, is filtered by the slicer or uses the Date field directly, it will still only display the selected month, even though the measure calculates across all dates.

        If you want to display all dates regardless of the slicer, you have a few options

        1. Remove the slicer’s interaction with the visual.
        2. Use a disconnected date table for filtering.
        3. Create a separate visual to show totals for all dates.

        I hope that’s helpful. Let me know if you need any further assistance.

         

        Regards,

        Yugandhar.