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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
prashantg364
Helper II
Helper II

DAX

I Have a table as shown below and I want to have a calculated column in the last to show the pass KPI count.
input table

AreaKPI1KPI2KPI3KPI4KPI5KPI6KPI7KPI8KPI9KPI10
sdcpasspasspasspasspasspassfailpasspassfail
sdfpassfailfailfailpasspasspasspasspassfail
gfrpasspassfailpasspasspasspasspasspassfail
ertpasspasspasspasspasspasspasspasspasspass
yuipasspassfailpasspasspasspasspassfailfail
mnhpasspasspasspassfailpasspasspassfailfail
gfdpasspasspasspassfailpasspasspasspassfail

 

output table

AreaKPI1KPI2KPI3KPI4KPI5KPI6KPI7KPI8KPI9KPI10Pass KPI count
sdcpasspasspasspasspasspassfailpasspassfail8
sdfpassfailfailfailpasspasspasspasspassfail6
gfrpasspassfailpasspasspasspasspasspassfail8
ertpasspasspasspasspasspasspasspasspasspass10
yuipasspassfailpasspasspasspasspassfailfail7
mnhpasspasspasspassfailpasspasspassfailfail7
gfdpasspasspasspassfailpasspasspasspassfail8
1 REPLY 1
ppm1
Solution Sage
Solution Sage

You should consider unpivoting your data into KPI and Result columns and just create a measure where the Result = "pass". That would be best practice. You could easily recreate the pivoted view in a matrix visual by putting the KPI column on columns in the matrix.

 

However, if you still want a calculated column, you could do it in the query editor with Record.ToList(_) and then counting the ones that are "pass" with List.Select. Or you could create a virtual table in a variable in DAX with {[KPI1], [KPI2], ... } and then use COUNTROWS and FILTER on that table where [Value] = "pass'.

 

Pat

Microsoft Employee

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

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

Top Solution Authors