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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. 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
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon & SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.

Users online (1,589)