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

Help:Count number of id with condition

Hello,
I have 2 tables ,table 1 and table 2 are joined by ID, i create a mesure 

Measure=Table1[Mes1]/Table2[Mes2]

With filter on year in 2021 :

IDMeasure
R1BLANK
R2x
R3y

With filter on year in 2022 :

IDMeasure
R1z
R2x
R3y

How can i countrow table with condition 1= measure >=0 and condition 2=measure <>Blank
I want the number of id with measure >=0 without line with blank measure.
I try countrow(relatedtable(table2),table1[Measure]>=0) but for 2021 i have 3 and It should be 2 ( R2 and R3 without R1 because it's <0)
Thank for your help!

3 REPLIES 3
amitchandak
Super User
Super User

@Datavizuserpbi, Try like

 

Countx(filter(summarize(ID, ID[ID], "_1",[Mes1], "_2", [Mes2]), [Mes1] >0), [Mes2])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

It's not working, when i'm using date filter i have blank for 2022

Hi, @Datavizuserpbi 

Not fully sure what you want.

Could you share your example file to further illustrate your problem?

 

Best Regards,
Community Support Team _ Eason

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