Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.
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 ) )
Check out the November 2023 Power BI update to learn about new features.
Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.