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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Sriku
Helper IV
Helper IV

Countif in pivot

Hi Team,

After applying filter in the data I need to count how many are H/M/L  (L <5,M<8,H>8) and based on the count need to plot a pie.

 

Please help.Countif.PNG

 

 

1 ACCEPTED SOLUTION
v-lili6-msft
Community Support
Community Support

hi  @Sriku 

If [H/M/L] is a calculate column or calculate measure?

If it is a calculate column, you could just drag [H/M/L] column into legend of a pie chart and then drag [Count of H/M/L]in Value and set aggregate type is Count.

 

If it is a calculate measure, you need a separate table that contains 'Low' 'Medium' 'High',

then create a measure like below logic

Measure 3 = var _table=FILTER(CROSSJOIN(ADDCOLUMNS('Fact',"_type",[Measure]),'Type'),[_type]=[Type]) return
COUNTROWS(_table)

here is a same post i have solved, you could refer to it

https://community.powerbi.com/t5/Desktop/Use-measure-as-chart-legend/m-p/1237315#M547738

 

Regards,

Lin

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

View solution in original post

2 REPLIES 2
v-lili6-msft
Community Support
Community Support

hi  @Sriku 

If [H/M/L] is a calculate column or calculate measure?

If it is a calculate column, you could just drag [H/M/L] column into legend of a pie chart and then drag [Count of H/M/L]in Value and set aggregate type is Count.

 

If it is a calculate measure, you need a separate table that contains 'Low' 'Medium' 'High',

then create a measure like below logic

Measure 3 = var _table=FILTER(CROSSJOIN(ADDCOLUMNS('Fact',"_type",[Measure]),'Type'),[_type]=[Type]) return
COUNTROWS(_table)

here is a same post i have solved, you could refer to it

https://community.powerbi.com/t5/Desktop/Use-measure-as-chart-legend/m-p/1237315#M547738

 

Regards,

Lin

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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