Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I have a table names "Payment" as follows with four filed.
I need to generate the fourth coulumn CountItem.
In excel it was farely simple using the countif(), how do we do it here using dax?
Item Date Amount CountItem
A 01-Jan-2018 10 3
A 02-Jan-2018 10 3
A 03-Jan-2018 10 3
B 01-Jan-2018 10 2
B 02-Jan-2018 10 2
C 01-Jan-2018 10 2
C 02-Jan-2018 10 2
Thanks,
Sami
Solved! Go to Solution.
HI Sami @samihuq
CountItem = VAR myitem = TableName[Item] RETURN COUNTROWS ( FILTER ( TableName, TableName[Item] = myitem ) )
@samihuq,
You can also use the following DAX.
CountItem = CALCULATE(COUNT(Table[Item]),ALLEXCEPT(Table,Table[Item]))
Regards,
Lydia
@samihuq,
You can also use the following DAX.
CountItem = CALCULATE(COUNT(Table[Item]),ALLEXCEPT(Table,Table[Item]))
Regards,
Lydia
HI Sami @samihuq
CountItem = VAR myitem = TableName[Item] RETURN COUNTROWS ( FILTER ( TableName, TableName[Item] = myitem ) )
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
96 | |
77 | |
66 | |
53 |
User | Count |
---|---|
144 | |
105 | |
102 | |
89 | |
63 |