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.
Hello,
How do I display Product Categories and Product Count Against each category in a tabular format?
Just like writing
SELECT c.Name AS Category, Count(p.ID) AS ProductCount
FROM Category c
INNER JOIN Product p ON c.ID = p.CategoryID
GROUP BY c.Name
And is it possible to even write SQL Queries in PowerBI? I use to do this in QlikView!
Thanks.
Solved! Go to Solution.
Hi @Aweklin,
Perhaps you can try to use group function of power query.
Referecn link:
Group rows in a table (Power Query)
Regards,
Xiaoxin Sheng
Hi @Aweklin
If your datasource is an SQL datasource then you can just run this SQL as your query into your table and let the DB Engine do the grouping. Otherwise you can do this both in the Query Editor and in DAX.
In DAX the forumla will look something like :
New Table = SUMMARIZE ( '<your table>' , [Name] , "ProductCount" , COUNTROWS('<your table>') )
Hi @Aweklin
If your datasource is an SQL datasource then you can just run this SQL as your query into your table and let the DB Engine do the grouping. Otherwise you can do this both in the Query Editor and in DAX.
In DAX the forumla will look something like :
New Table = SUMMARIZE ( '<your table>' , [Name] , "ProductCount" , COUNTROWS('<your table>') )
Hi @Aweklin,
Perhaps you can try to use group function of power query.
Referecn link:
Group rows in a table (Power Query)
Regards,
Xiaoxin Sheng
You should be able to add Category and ID to a table visualization. On the ID click the little down arrow and select "Count" (Values section of the table element on the right side menu).
I'm not familiar with QlikView. You can use SQL to get your data into Power BI from a source that supports it, but DAX is used to create measures and calculated columns within the model.
Brett
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 |
---|---|
110 | |
96 | |
77 | |
63 | |
55 |
User | Count |
---|---|
143 | |
109 | |
89 | |
84 | |
66 |