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
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
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.