Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
Hi,
I have data like this (see below)
And would like to have a Dax query in Power Bi to have the output like this: (See below)
Help!!
Solved! Go to Solution.
First, I'd learn about PROPER MODEL DESIGN (star schema).
Second, I'd denormalize the table (unpivot it in Power Query).
Then, I'd create a Date table the way it should be and connect it to the main table (with the names).
Then, I'd write a very simple DAX measure to compute what you want.
The table, Actions, would be:
Name,Action,Date
Name1,Senttweet,7/13/2019
Name2,Senttweet,7/7/2019
...
Then you'd have the Date table and would join it to the above on the Date field (which would be present in both tables). The Date table must be A PROPER DATE TABLE (not just any table, please read about a proper date table in Power BI).
If you do the above, then your DAX will be clean, fast and easy to understand/maintain. It'll be this:
[Qty] = COUNTROWS( Actions )
-- add 0 to this to show 0's instead of BLANKS, like this:
[Qty] = COUNTROWS( Actions ) + 0
You then should hide the Date column in the Actions table and slice by time only using the Date table.
Best
Darek
First, I'd learn about PROPER MODEL DESIGN (star schema).
Second, I'd denormalize the table (unpivot it in Power Query).
Then, I'd create a Date table the way it should be and connect it to the main table (with the names).
Then, I'd write a very simple DAX measure to compute what you want.
The table, Actions, would be:
Name,Action,Date
Name1,Senttweet,7/13/2019
Name2,Senttweet,7/7/2019
...
Then you'd have the Date table and would join it to the above on the Date field (which would be present in both tables). The Date table must be A PROPER DATE TABLE (not just any table, please read about a proper date table in Power BI).
If you do the above, then your DAX will be clean, fast and easy to understand/maintain. It'll be this:
[Qty] = COUNTROWS( Actions )
-- add 0 to this to show 0's instead of BLANKS, like this:
[Qty] = COUNTROWS( Actions ) + 0
You then should hide the Date column in the Actions table and slice by time only using the Date table.
Best
Darek
Thanks so much!
After I have unpivoted those columns ('action'), it all made sense and was easy! (I am new to Power Bi)
thanks again.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 3 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 11 | |
| 9 | |
| 8 | |
| 7 | |
| 6 |