0
votes

I want to do countif in PowerBI (Example: count of total item with condition #1: having transaction of 2 or more, condition #2: year)

I have sample data comprised of PO (transaction) #, item #, date (year), item description, ship to location.

I can achieve the result through Excel - Pivot a matrix table of rows of items, columns of year and the value is count of PO/transactions. A separate table on the side is utilized to count the total item within Column (Years) that has transaction count > 2.

I can't figure out what DAX to use in PowerBI to achieve the same thing as I could with Excel:

enter image description here

Sample of transaction counts:

enter image description here

1

1 Answers

1
votes

Usually COUNTIFS in Excel are implemented by use of CALCULATE(<expression>,<filter1>,<filter2>…) in Power BI, for example:

CALCULATE(SUM(Table1[Column1]), FILTER(Table1, Table1[Column1] < Table1[Column2]))

Read more details here.