Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by watching the DP-600 session on-demand now through April 28th.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
Hello guys!
I wonder if there is a solution for the following. I want to count the number of occurence of each Product ID.
Input:
| Product ID |
| B |
| B |
| B |
| C |
| C |
| D |
| D |
| D |
| D |
| D |
Expected Output
| Product ID | Occurence |
| B | 3 |
| C | 2 |
| D | 5 |
Is there a way to achieve this through DAX?
Thank you!:)
Solved! Go to Solution.
Just drag your Product ID column into a table visual, and add this measure too.
Occurence = COUNT(Table[Product ID]) //replace table with actual table name
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
@Anonymous , on any visual plot this measure with product id
countrows(table)
Just drag your Product ID column into a table visual, and add this measure too.
Occurence = COUNT(Table[Product ID]) //replace table with actual table name
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Thank you this worked well!
Do you also happen to know how I can calculate the average of a measure? I would like to calculate the average occurrence in my next step but this doesnt seem to work with average dax function.
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 41 | |
| 37 | |
| 34 | |
| 21 | |
| 16 |
| User | Count |
|---|---|
| 65 | |
| 59 | |
| 31 | |
| 25 | |
| 25 |