Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Calculating the difference between two visuals with filters applied.

So I need to find the diffrence in contracts billed this month vs last month but the visuals have filters applied that I need to keep.

How would I do this in dax? 

 

 

  • Hi Anonymous ,

     

    Please try the measure.

     

    Measure = 
    CALCULATE (
        SUM ( 'Table'[Amount] ),
        FILTER (
            'Table',
            FORMAT ( 'Table'[Last Billed Date], "yyyymm" ) = FORMAT ( TODAY (), "yyyymm" )
        )
    )
        - CALCULATE ( SUM ( 'Table'[Amount] ), 'Table'[Billed Last Month] = "Yes" )

     

    If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
    Best Regards,
    Winniz
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

3 Replies

  • v-kkf-msft's avatar
    v-kkf-msft
    Icon for Community Support rankCommunity Support

    Hi Anonymous ,

     

    Please try the measure.

     

    Measure = 
    CALCULATE (
        SUM ( 'Table'[Amount] ),
        FILTER (
            'Table',
            FORMAT ( 'Table'[Last Billed Date], "yyyymm" ) = FORMAT ( TODAY (), "yyyymm" )
        )
    )
        - CALCULATE ( SUM ( 'Table'[Amount] ), 'Table'[Billed Last Month] = "Yes" )

     

    If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
    Best Regards,
    Winniz
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • Anonymous's avatar
      Anonymous
      Not applicable

      I ended up just makeing the mesures withing the visual itself and claculating the difference between the visual levele mesures.