Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
ManjunathaEP
Helper II
Helper II

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 1
ManjunathaEP
Helper II
Helper II

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.  

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.