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
Augustas-ase
Helper II
Helper II

How write powerbi formula Countifs

Hello,

How to write Formula from excel to Powerbi

My formula in excel is =IF(COUNTIFS(L:L;[@VALUE];N:N;"YES")>0;"YES";"NE")

please help me

1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

Hi, @Augustas-ase ;

Sorry, is countif not being used correctly on the way as I understand it, or can you share what your results are?
A simple example and want to output the result, attached to your logic. If we switch to Powerbi from Countif,
You can use:

count =
IF (
    CALCULATE ( COUNT ( [column] ), FILTER ( ALL ( table ), [column1] = "Yes" ) ) > 0,
    "Yes",
    "No"
)


Best Regards,
Community Support Team _ Yalan Wu
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

12 REPLIES 12
v-yalanwu-msft
Community Support
Community Support

Hi, @Augustas-ase ;

Is your problem solved? If so, Would you mind accept the helpful replies as solutions? Then we are able to close the thread. More people who have the same requirement will find the solution quickly and benefit here. Thank you.


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

v-yalanwu-msft
Community Support
Community Support

Hi, @Augustas-ase ;

Sorry, is countif not being used correctly on the way as I understand it, or can you share what your results are?
A simple example and want to output the result, attached to your logic. If we switch to Powerbi from Countif,
You can use:

count =
IF (
    CALCULATE ( COUNT ( [column] ), FILTER ( ALL ( table ), [column1] = "Yes" ) ) > 0,
    "Yes",
    "No"
)


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Augustas-ase
Helper II
Helper II

Maybe need to use two filters in the formula? Firstly to COUNTIFS(L:L;[@VALUE] after N:N;"YES"..

Yes, because there are two criterias in the CountIFs

Something like Filter(TableName,Condition1 && Condition 2) and then you can enclose it in IF

also maybe there is a difference that is L: L numbers and N: N Text maybe that's why it doesn't work out for me exactly, i get inaccurate information

Can you provide me the data set, I don't understand what L and N are.

A similar requirement can be found here

Augustasase_0-1649843672216.png

 

can you write the whole condition what it should look like?

in excel is: =IF(COUNTIFS(L:L;L1;N:N;"YES")>0;"YES";"NE")

Augustas-ase
Helper II
Helper II

no doesn't work:/

Are you getting any error?

Can you share your sample data?

PC2790
Community Champion
Community Champion

Try:

 

If(CALCULATE(COUNTROWS(TableName),FILTER(TableName,TableName[Value]="Yes"))>0,"Yes","No")

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