Forum Discussion

ManjunathaEP's avatar
ManjunathaEP
Helper II
5 years ago

Countrows for calculated measure

Hi, Thank you in advance for your support on this. I have data table as mentioned below and I would like to calculate the countrows of a column from the calculated measure:

 

Cust.NameY/N?AmountRev.Class
XYZY123Apple
ANFY344Apple
ABCY555Mango
JUFY222Apple
KIFY33Mango
JUSY55Mango
KFFY7676Orange
LSFY33Apple
XYZN66Mango
ANFN77Orange
SREN88Mango

I calculated the measure = calculate(sum('Table'[Amount]),FILTER(VALUES('Table'[Cust.Name]),CALCULATE(DISTINCTCOUNT('Table'[Y/N?])>1)))

Now: I would like to calculate the countrows of "Rev.Class" column, which is equal to the above measure

 

1 Reply

  • The requirement is on the count of orders. please find the calculated measure as given below:

    order NoCust NameY/N?Revenue classAmount
    111ABCYApple100
    112XYZNApple22
    113ABCNApple300
    114XYZYOrange66
    115DFGNApple667
    116DDFYOrange567
    112XYZNMango345
    111ABCYMango349

     

    I have calculated a measure = calculate(DISTINCTCOUNT('Table'[order No]),FILTER(VALUES('Table'[Cust.Name]),CALCULATE(DISTINCTCOUNT('Table'[Y/N?])>1))) and I got the answer "4" orders.
    Now: I would like to get count of orders by Rev.Class. In the given example: The answer should be Apple=2, Mango=2. My requirement here is to calculate the count of orders by Rev.class, which is equal to the calculated measure above.