Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

How to Count Conditional Visual Column based on DAX

Hi All,

I have cummulative perecnetages driven by DAX in term of context transition. On that percentages i have applied condition by AA,A,C & D which is working correctly , now i want count how many AA , A, B C & D , Could you please assist. 

 

All measures calculated based on DAX

 

% of Cummulative Total = DIVIDE([Cummulative total],[sum of total orders by SKU])

 

 

Class by cumm % = if(
NOT(ISBLANK([% of Cummulative Total])),
switch(
TRUE(),
[% of Cummulative Total] <= 0.40, "AA",
[% of Cummulative Total] <= 0.60, "A" ,
[% of Cummulative Total] <= 0.75,"B",
[% of Cummulative Total] <= 0.85,"C",
[% of Cummulative Total] <= 1,"D",
"None"
))

 

 

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

    Please have a try.

    Create a measure.

     

    coutncolumn = CALCULATE(COUNT('Table'[Class by cumm]),FILTER(ALL('Table'),'Table'[Class by cumm]=SELECTEDVALUE('Table'[Class by cumm])))

     

    If I have misunderstood your meaning, please provide more details with your desired output.

     

    Best Regards

    Community Support Team _ Polly

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

     

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Sir, Much appreciate your response for this query, Ok i will explian you , In raw data I have SKU & Order Columns , rest all achived by using DAX Cummulative Total , Cummulative Percentage , Class by Cumm all there is no such coulumns in raw data table.

      I have below info to calculate ther metrics & measures , which i have almost done except to count how many A, B & C.

       

      Pls let me know if you need more info

       

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi Anonymous ,

        I'm sorry I got a little confused. What is your desired output? Could you please provide you pbix file without privacy information(or some sample data) and desired output with more details( Best output in image form with text explanation)

         

        Best Regards

        Community Support Team _ Polly

         

        If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.