Forum Discussion

redgun24's avatar
redgun24
New Member
6 years ago
Solved

DAX Help - Calculating Count at Subtotal Level

Hi all,

 

New to DAX. I'm trying to only show conflicts (1, 2, 3, 4, 5) in the below visualization that have more that one entitlement (AP Invoice Entry, AP Supplier Master, etc.). For the example below the desired end result would be to see conflicts 3 & 5 disappear because they only have one entitlement rather than two.

 

I tried using a filter but realized that applied at the lowest level, in this case the entitlement. Is there a way to add a measure that would calculate the # of entitlements under a given conflict? I could then use this as a slicer or to filter.

 

Thank you!

 

Exanoke

  • Hi redgun24 

    Try to add measure in your table

    Measure = calculate(count('Table'[Entitlement]);ALLSELECTED('Table'[Entitlement]))

    then in Filters pane add "Measure" to a "Filters on this visual" and check Measure is greater than 1 

4 Replies

  • Nathaniel_C's avatar
    Nathaniel_C
    Community Champion

    Hi redgun24 ,
    If I understand, you want to filter the visual. Try this measure:

    Show only = If(MAX(Conflicts[Counter])>1,MAX(Conflicts[Counter]),BLANK())

    my table is Conflicts.
    Let me know if you have any questions.

    If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
    Nathaniel

     

     

    • redgun24's avatar
      redgun24
      New Member

      Hey Nathaniel,

       

      Thank you for the reply. I tried the formula, assuming that your Counter is my Count of Entitlements but was getting the below error. Am I missing something? 

       

  • az38's avatar
    az38
    Community Champion

    Hi redgun24 

    Try to add measure in your table

    Measure = calculate(count('Table'[Entitlement]);ALLSELECTED('Table'[Entitlement]))

    then in Filters pane add "Measure" to a "Filters on this visual" and check Measure is greater than 1 

    • redgun24's avatar
      redgun24
      New Member

      Hey Az38,

       

      I was able to get this to work. Thank you!

      Az38 = calculate(count('Conflicts & Entitlements'[Entitlement]), ALLSELECTED('Conflicts & Entitlements'[Entitlement]))