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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anonymous
Not applicable

Filter measure by another measure

Hello,

I have two different measures:

 

pcount = distinctcount(data[portfolio])
hg = divide(sum(data[amount]), sum(data[realizedAmount]))
hg_x = divide(sum(data[amount]), sum(data[realizedAmount2]))

 


What i want to achieve is to create two new measures. One gets the count of portfolios that have hg>=1 and other one gets the count of portfolios that have hg_x>=1.

I've tried to create formula like below but it gives me an error.

 

 

measure = calculate(pcount, hg>=1)

 

 


Any help would be appreciated. 

1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

How about this?

COUNTROWS ( FILTER ( DISTINCT ( data[portfolio] ), [hg] >= 1 ) )

 

This creates a list of distinct portfolios, filters for the specified condition, and counts how many are left.

View solution in original post

4 REPLIES 4
v-henryk-mstf
Community Support
Community Support

Hi @Anonymous ,

 

Whether the advice given by @AlexisOlson @philouduv  has solved your confusion, if the problem has been solved you can mark the reply for the standard answer to help the other members find it more quickly. If not, please point it out.


Looking forward to your feedback.


Best Regards,
Henry

AlexisOlson
Super User
Super User

How about this?

COUNTROWS ( FILTER ( DISTINCT ( data[portfolio] ), [hg] >= 1 ) )

 

This creates a list of distinct portfolios, filters for the specified condition, and counts how many are left.

Anonymous
Not applicable

Hi,

This is the solution i'm looking for.

Thanks for your answers @philouduv @AlexisOlson 

philouduv
Resolver III
Resolver III

Hey @Anonymous ,

I do not have your data model and neither your data columns but I am guessing that you have a portfolio name and/or id with an amount  and amount_realised 1 and amount_realised 2

If I am correct, I am advicing you to create 2 new column(hg and hg_x) like this:

hg_value = data[amount] / data[realised_amount1]

do the same with hg_x 

Then create a new measure :

hg_measure = 

calculate(SUM(datasource[hg_value]),
filter(ALL(datasource),
datasource[hg_value] >1))

and do the same replacing hg_value by hg_x_value


Best regards,

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors