Forum Discussion

kartikmeher's avatar
kartikmeher
Frequent Visitor
3 years ago

count rows in a table visual created by measure

I have made the following table visual using measures.
Now i want to create different KPIs which reflect count of each class.

All this columns are calculated using measure.

cannot share the pbix file as it is confidential data

 

3 Replies

  • Hi kartikmeher ,

     Assuming that SKU is not a measure,

    To get a count of A+ SKUs, you can do CALCULATE(COUNT( on SKU, and filter on the same criteria that you use to get A+ in the class measure.

     

    Please accept as solution if this answers the question- thanks!

     

    • kartikmeher's avatar
      kartikmeher
      Frequent Visitor

      hi,

       

      following are the measures i have used

       

      Frequency = COUNTA(SALES_DATA_AI_ENABLED[sku])
       
      rank = RANKX(ALL(SALES_DATA_AI_ENABLED[sku]),[Frequency],,,Skip)
       
      Cumulative Total based on Rank =
                 CALCULATE([Frequency],
                           TOPN([rank],ALL(SALES_DATA_AI_ENABLED[sku]),[Frequency])
                 )
       
       
      % of Products Running Total =
               DIVIDE([Cumulative Total based on Rank],CALCULATE([Frequency],ALL(SALES_DATA_AI_ENABLED[sku])))
       
       
      ABC switch = SWITCH(TRUE(),
      SALES_DATA_AI_ENABLED[% of Products Running Total]<=0.39,"A+",
      SALES_DATA_AI_ENABLED[% of Products Running Total]<=0.59,"A",
      SALES_DATA_AI_ENABLED[% of Products Running Total]<=0.81,"B",
      "C")
       
       
      i have tried your logic, and it isnt working
       
      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi kartikmeher ,

        Please create a measure as below to get it:

        A+ KPI = COUNTX ( FILTER ( SALES_DATA_AI_ENABLED, [ABC switch] = "A+" ), [sku] )

        If the above one can't help you get the desired result, please provide some fake data in your table 'SALES_DATA_AI_ENABLED' (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

        How to upload PBI in Community

        Best Regards