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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
GAPER
Post Patron
Post Patron

CountA add condition

GAPER_0-1704439224390.png

 

Here is the formula powerBI suggested - How do I condition that only selecting unrealised_value_usd > 0?

 

Basically i wanna return the count of Pure_Project_id where the column unrealised_value_usd >0

 

To be exact

 

GAPER_0-1704440280193.png

I would like to return Count of Project for each project based on how many "Unrealised_Value_USD" that's >0. Obviously the formula I have here is wrong. (the first few Project has the same Name but a different Count of Project)

 

Count of Project =
CALCULATE(
    COUNTA(DIM_Project[PROJECT]),
    ALLSELECTED('FACT_Holdings'[UNREALIZED_VALUE_USD] )
)

 

Thanks. 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @GAPER ,

Here some steps that I want to share, you can check them if they suitable for your requirement.

Here is my test data:

DIM_Project table:

vheqmsft_0-1704787287657.png

FACT_Holdings table:

vheqmsft_1-1704787341151.png

1.Create measure

 

Count of Project =
CALCULATE (
    CALCULATE (
        COUNTA ( DIM_Project[PROJECT] ),
        FILTER ( FACT_Holdings, FACT_Holdings[UNREALIZED_VALUE_USD] > 0 )
    ),
    ALLSELECTED ( 'FACT_Holdings'[UNREALIZED_VALUE_USD] )
)

 

2.Final output

vheqmsft_0-1704787495878.png

Best regards

Albert He

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
Anonymous
Not applicable

Hi @GAPER ,

Here some steps that I want to share, you can check them if they suitable for your requirement.

Here is my test data:

DIM_Project table:

vheqmsft_0-1704787287657.png

FACT_Holdings table:

vheqmsft_1-1704787341151.png

1.Create measure

 

Count of Project =
CALCULATE (
    CALCULATE (
        COUNTA ( DIM_Project[PROJECT] ),
        FILTER ( FACT_Holdings, FACT_Holdings[UNREALIZED_VALUE_USD] > 0 )
    ),
    ALLSELECTED ( 'FACT_Holdings'[UNREALIZED_VALUE_USD] )
)

 

2.Final output

vheqmsft_0-1704787495878.png

Best regards

Albert He

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

qqqqqwwwweeerrr
Super User
Super User

Hi @GAPER 

 

Can you check this solution https://community.fabric.microsoft.com/t5/Desktop/Product-Counts-Based-on-Measure-Values/m-p/3618735... which is similar to you case if not please provide more details

 

Regards

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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