Forum Discussion

darry3ni's avatar
darry3ni
Frequent Visitor
5 years ago
Solved

Different measure result for Table Visual Title

I'm trying to use a measure as a dynamic title for a table visual but it returns the wrong value.

 

Included is a test example of this:

  1. Source for countrows is the same (partly whited out)
  2. Source contains 27 rows.
  3. Image has a slicer visual over a table visual.

  • Was able to make it work by adding DISTINCT after COUNTROWS on both sides.

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    darry3ni first red flag here is the use of ALLSELECTED - what exactly are you trying to achieve with that function?

    ALLSELECTED() is somewhat notorious for being one of the most complicated DAX functions, so unless you have a very specific reason that requires it I would see if there are alternatives you could be using to achieve the same result more simply?

    • darry3ni's avatar
      darry3ni
      Frequent Visitor

      I have another slicer to filter the table, so I'm using ALLSELECTED to return a row count of the filtered table. Is there an easier way to get that row count?

      • Anonymous's avatar
        Anonymous
        Not applicable

        Did you try just using a regular COUNTROWS( Main Table) without the ALL()?

        Also, are you actually trying to return a row count or are you just trying to determine if the table is filtered?  If the latter, I'd recommend just using the ISFILTERED() function.

  • darry3ni's avatar
    darry3ni
    Frequent Visitor

    Was able to make it work by adding DISTINCT after COUNTROWS on both sides.