Forum Discussion

appsac1's avatar
appsac1
Helper I
3 years ago
Solved

Count

Hello,

I have created a simple table 

 

 

where measure

Count_Lost2 = if([Last_Sales]==BLANK(),1)

 

I want to count this coulmn. Is it not possible to count measures?

 

Thanks for any help.



 

  • You need to create a variable to hold the values at the granularity you want, then you can run SUMX over that. If you wanted it at year level you could use something like

    Count of measure =
    VAR SummaryTable =
        ADDCOLUMNS ( VALUES ( 'Date'[Year] ), "@value", [Measure to count] )
    RETURN
        SUMX ( SummaryTable, [@value] )
    

3 Replies

  • You need to create a variable to hold the values at the granularity you want, then you can run SUMX over that. If you wanted it at year level you could use something like

    Count of measure =
    VAR SummaryTable =
        ADDCOLUMNS ( VALUES ( 'Date'[Year] ), "@value", [Measure to count] )
    RETURN
        SUMX ( SummaryTable, [@value] )
    
  • tb0493's avatar
    tb0493
    Frequent Visitor

    Need some help, Can someone describe how excel counts and calculation can be performed in Power BI? I have a dataset and I think DAX COUNTA or COUNTAX maybe part of the solution. Please provide the format in DAX, it would be much appreciated!