cancel
Showing results for
Did you mean:

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Regular Visitor

## calculating percentage of errors in a column

Hi,

I have a table with the first column having data type of number but the data is type of text (in purpose). I need to calculate the percentage of error records compaired to the column and the whole table (all columns).

1 ACCEPTED SOLUTION
Super User

If you want just the overall rows error count in DAX, you can use this:

Add the measure and mark it as % data type in the formatting pane:

``````Percentage 2 =
var _sel = COUNTROWS(
Filter(
ALL('Table'[Column1]),
"Converted Column 2",
IF ( ISERROR(VALUE('Table'[Column1])), BLANK(), VALUE('Table'[Column1]))
)
, [Converted Column 2] = BLANK()
)
)

RETURN  DIVIDE ( _sel, COUNTROWS(ALL('Table'[Column1]))  , BLANK())``````

2 REPLIES 2
Super User

and using that you can do the calculation.

DAX: It is not clear you want percentage measure or have a column and percentage. Providing adding a column and percentage measure.

Converted Column = IF(ISERROR( Value('Table'[Column1])), BLANK(), Value('Table'[Column1]))

Add the measure and mark it as % data type in the formatting pane:
Percentage of Errors = COUNTBLANK('Table'[Converted Column]) / COUNTROWS('Table')

Hope this helps!

Super User

If you want just the overall rows error count in DAX, you can use this:

Add the measure and mark it as % data type in the formatting pane:

``````Percentage 2 =
var _sel = COUNTROWS(
Filter(
ALL('Table'[Column1]),
"Converted Column 2",
IF ( ISERROR(VALUE('Table'[Column1])), BLANK(), VALUE('Table'[Column1]))
)
, [Converted Column 2] = BLANK()
)
)

RETURN  DIVIDE ( _sel, COUNTROWS(ALL('Table'[Column1]))  , BLANK())``````