Warm tip: This article is reproduced from stackoverflow.com, please click
dax powerbi

How to count different elements inside a column in power BI?

发布于 2020-04-04 10:12:01

I have to implement one misure which is to be used to count the number of "1" inside a column. In this column are contained 1, 0 and NULL. Which DAX formula do you suggest me?

Questioner
Firingam
Viewed
74
Sizzling_Boots 2020-01-31 22:09
    Count 1's = 
    CALCULATE( COUNT( 'Table'[Column1] ),
        'Table'[Column1] = 1 )

Use calculate to specify what you want (count) and then give it parameters, which in this case is where the column values = 1.