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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Afaque_Eclerx
Frequent Visitor

Dax to get countifs value as im getting in excel

Hi Team,

 

In excel im using formula like =COUNTIFS(O:O,O2,M:M,"in stock") and  COUNTIFS(A:A,A2,M:M,"in stock") Kindly let me know how can I replicae the same in Power BI.

1 REPLY 1
Anonymous
Not applicable

Hi @Afaque_Eclerx ,

 

Firstly, I suggest you to add an index column in Power BI, due to the calculation in Power BI is based on column.

RicoZhou_0-1678693311616.png

Convert =COUNTIFS(O:O,O2,M:M,"in stock") to a measure:

Countif = 
VAR _O2 = CALCULATE(MAX('Table'[O]),'Table'[Index] = 1)
return
CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[O] = _O2 && 'Table'[M] = "in stock"))

My Sample:

RicoZhou_1-1678693565643.png

Result is as below.

RicoZhou_2-1678693572508.png

 

Best Regards,
Rico Zhou

 

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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.