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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Syndicate_Admin
Administrator
Administrator

How to count a column resulting from a measure/calculation

Hello everyone,

I am wanting to do a count of a specific column that is the result of a Measure that results in a TEXT:

Detail:

Highest Pharmacy = IF(IF(CALCULATE(COUNT(Data[Price Seniors]),Data[Price Seniors]>0)>1,CALCULATE(.MAX(Data[Price Seniors])),"Not Captured")="Not Captured","Not Captured",IF([But High]=Calc_Kielsa[Kielsa],"Kielsa",IF([But High]=Calc_Siman[Siman],"Siman",IF([But High]=Calc_FA[FA],"FA","Not Captured"))))
OlmatrixHN504_0-1672262111068.png

and what I want to do is a count of how many times FA appears in that calculation/column

1 ACCEPTED SOLUTION

Good morning.

Thanks for responding.

It did not work, because the comlumna of [Farmacia Más Alta], is the result of an Expression (measure, Calculation), which using COUNT (I needed a COUNTIF of an expression) was not going to work according to the suggested formula.

Which solution was solved in two steps:

1) First step; Count per row, which the formula is: FA> = IF([Highest Pharmacy]="FA",1,0)

2) Second step; Add those counts with: Measure= SUMX(ALLSELECTED(Data[Product]),Calc_FA[FA>])

This solved the problem for me, I hope it will serve you all.

OlmatrixHN504_0-1672333991777.png

View solution in original post

2 REPLIES 2
v-stephen-msft
Community Support
Community Support

Hi @OlmatrixHN504 ,

  

You can create a measure to count like

Count FA = COUNTROWS(FILTER(ALLSELECTED('Table'),[Highest Pharmacy]="FA"))

vstephenmsft_0-1672283088381.png

 

Best Regards,

Stephen Tao

 

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

Good morning.

Thanks for responding.

It did not work, because the comlumna of [Farmacia Más Alta], is the result of an Expression (measure, Calculation), which using COUNT (I needed a COUNTIF of an expression) was not going to work according to the suggested formula.

Which solution was solved in two steps:

1) First step; Count per row, which the formula is: FA> = IF([Highest Pharmacy]="FA",1,0)

2) Second step; Add those counts with: Measure= SUMX(ALLSELECTED(Data[Product]),Calc_FA[FA>])

This solved the problem for me, I hope it will serve you all.

OlmatrixHN504_0-1672333991777.png

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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