Power BI: using SumIF and CountIF

Опубликовано: 14 Июль 2026
на канале: Speak English Clearly
3,853
31

This video shows how to use SumIF and CountIF in Power BI. Unlike in Excel, there are no SumIF and CountIF functions in Power BI. However, there are a few different ways we can work around this:

One way to replace SumIF is to use the CALCULATE function and set a certain criteria in the filter parameter.

To use CountIF, we can drag an appropriate column to a visual and change the sum calculation to count in the visualization pane. The filter context will do the rest and you''ll get the count of values.

The second option is to create a measure using the CountA or COUNTROWS functions.

Finally, you can create a separate calculated column that counts the number of repeating values in a column, using a DAX code similar to the one below:

Number of transactions =
VAR CurrentRowDate = Sales[DateKey]
RETURN
COUNTROWS( FILTER (
ALL(Sales), CurrentRowDate = Sales[DateKey]))

Download a PBIX file to work along with me: https://cutt.ly/VhS03Ka

#PowerBI #DAX
#CountIF #SumIF