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.
Solved! Go to Solution.
Hi @Anonymous,
You can add a calculated column to the table as below
Category Count = VAR countr= COUNTROWS(FILTER(Table1,Table1[Category]=EARLIER(Table1[Category])))
Return "Categories with " & countr & " products."
This will give you a count for the category against each row. Then you can use this column in standard visuals like Matrix or Table.
I have generated a sample data with some retail categories and added products to each category. You can download the pbix from the link below and give it a try.
https://www.dropbox.com/s/tdi3elkayn3elrz/Category%20Count.pbix?dl=0
Please mark this post as an accepted solution if this helped you.
Regards,
Affan
Hi @Anonymous,
You can add a calculated column to the table as below
Category Count = VAR countr= COUNTROWS(FILTER(Table1,Table1[Category]=EARLIER(Table1[Category])))
Return "Categories with " & countr & " products."
This will give you a count for the category against each row. Then you can use this column in standard visuals like Matrix or Table.
I have generated a sample data with some retail categories and added products to each category. You can download the pbix from the link below and give it a try.
https://www.dropbox.com/s/tdi3elkayn3elrz/Category%20Count.pbix?dl=0
Please mark this post as an accepted solution if this helped you.
Regards,
Affan
Hi Affan
that is very helpful. The numbers I get are very weird but it's a very complicated model. So I got the logic behind it, now studying the EARLIER function.
thanks
Can't think of a way with DAX. I think that the most straight-forward way with DAX would be to create a table like:
Table = VAR __table = SUMMARIZE('Table',[Category],"__count",COUNT([Some Column])) RETURN DISTINCT(__table[__count])
Something like that, didn't try it specifically. Then use this table column as your axis. I don't know, there's an issue somewhere in there I'm sure, will have to think about it.
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 |
---|---|
114 | |
99 | |
82 | |
70 | |
60 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |