Forum Discussion

jakubk's avatar
jakubk
Icon for Helper I rankHelper I
6 years ago

Card showing wrong rowcount. whatif filter ignored

my data source is star schema datamart

i have a simple viz that's filtered by slicers based on dimension attribute values

i also have a whatif param that i'm using to filter the viz to only records where my physical measure is less than or equal to the whatif value

 

i've set it up by doing a calc in my fact table:= measure - whatif value

then i added this as a filter to the viz and set it as less than or equal to 0. I'm not sure if there's a less convoluted way of setting this up?

 

I want to add a card or something that shows a simple # of rows that make up the viz but the number i'm getting is too big. I've verified it by changing my viz to a table; i can see it's 20 rows but the row count card is showing 200+

 

it seems like the card is ignoring the whatif filter and i cant seem to add it to the card as a filter and configure it

 

is this a bug?

is there a workaround?

15 Replies

  • jakubk reason it works in table because your filter is calculated for each row, whereas on card visual there is no row context and it is calculated at total level. you should use countx function to calculate # of rows 

    • jakubk's avatar
      jakubk
      Icon for Helper I rankHelper I

      Thanks for the tip but i'm going to need more info.

       

      Use it how?

      I've looked up the docs for countx

      I dont want to hardcode filters in a dax query

       

      surely i can get a rowcount of a filtered dataset without having to duplicate the filters/slicers and make sure i keep my dax up to date?

      • Icey's avatar
        Icey
        Icon for Community Support rankCommunity Support

        Hi jakubk ,

        You can build a concrete example and tell me the result you want. I will conduct specific tests.

         

        Best Regards,

        Icey