Forum Discussion

yoyfreddy's avatar
yoyfreddy
Frequent Visitor
4 years ago
Solved

Date filter not working

Hello experts!   I have a table containing the Unit Cost of different Cost Category. I want users to customize the period on time slicer, then display the Total Cost (Unit Cost x No.of Units) acros...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi  yoyfreddy ,

    You should use measure instead because slicer chart is in report level while calculate column is in data model level so slicer will not affect calculate column. However, slicer can affect the result of a measure.

    Here are the steps you can follow:

    1. Create measure.

    Unit Cost in period_measure =
     MAX( Cost[Unit Cost])*
        CALCULATE(sum(OpStat[Value]),
            DATESBETWEEN('Date'[Date].[Date],FIRSTDATE('Date'[Date]),LASTDATE('Date'[Date])))

    2. Result:

    2021.1.1 – 2021.12.31

    2021.1.1 – 2021.7.14

     

    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