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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.