Forum Discussion

CarlBlunck's avatar
CarlBlunck
Icon for Resolver I rankResolver I
2 years ago
Solved

Calculate with not equal to filter issue

Hi team,

 

I have this measure:

 

PerformanceReview_Total = CALCULATE(
    DISTINCTCOUNT(fact_PerformanceReview[Person Person No.]),
    fact_PlacementData[PersonStatus] = "Existing",
    fact_PlacementData[BaseClass] <> "UNPAID"
)
 
Which is working as expecting.  However, when I use a filter on this page that lets me select a value from the fact_PlacementData[BaseClass] column, the value of the measure is not changing.
 
When I update the measure to be:
 
PerformanceReview_Total = CALCULATE(
    DISTINCTCOUNT(fact_PerformanceReview[Person Person No.]),
    fact_PlacementData[PersonStatus] = "Existing"
)
 
The value of the measure does change when select a value from the fact_PlacementData[BaseClass] column when using a filter on this page.
 
Here is the issue - I swear, last week, the value was updating when I had the fact_PlacementData[BaseClass] <> "UNPAID" filter in the measure.  But now it's not and I can't understand why.
 
Any thoughts or ideas?
 
Thanks
Carl
  • CarlBlunck I just answered the similar question, update your measure to this:

     

    PerformanceReview_Total = CALCULATE(
        DISTINCTCOUNT(fact_PerformanceReview[Person Person No.]),
        KEEPFILTERS ( fact_PlacementData[PersonStatus] = "Existing" ),
        KEEPFILTERS ( fact_PlacementData[BaseClass] <> "UNPAID" )
    )

     

    To learn more about keepfilters, check this video on my YT channel:

     

4 Replies

  • CarlBlunck I just answered the similar question, update your measure to this:

     

    PerformanceReview_Total = CALCULATE(
        DISTINCTCOUNT(fact_PerformanceReview[Person Person No.]),
        KEEPFILTERS ( fact_PlacementData[PersonStatus] = "Existing" ),
        KEEPFILTERS ( fact_PlacementData[BaseClass] <> "UNPAID" )
    )

     

    To learn more about keepfilters, check this video on my YT channel:

     

    • CarlBlunck's avatar
      CarlBlunck
      Icon for Resolver I rankResolver I

      Thanks parry2k !  Did something change lately to require the keepfilters() function to be included?  

    • CarlBlunck's avatar
      CarlBlunck
      Icon for Resolver I rankResolver I

      Interesting parry2k - last week I swear it was behaving differently.  But could also be dreaming...  Thanks for helping me with this.