Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
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.
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.
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:
Result is as below.
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.