Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join 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.

Reply
simardd
New Member

Help!!!! Looking for the proper dax function to come up with this table

Hi,
I have data like this (see below)
data.png


And would like to have a Dax query in Power Bi to have the output like this: (See below)
Help!! 

output.png

1 ACCEPTED SOLUTION
Anonymous
Not applicable

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

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

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.


Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.