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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Count rows by month for 2 different date columns

Hello,

 

I have a table containing 2 date columns:

 

Sans titre1.png

 

What I want in my visual is the count of Created and Updated by month in the same graph like this:

 

Sans titre.png

 

I can't figure out how to have a common date value for the 2 measures. I guess I need to create a DAX table but I've failed to have the expected result so far. My aggregated data should look like this:

 

Sans titre2.png

 

Regards

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @Anonymous,

 

You need to create a calendar table check the links below for a DAX and a M code option (just two examples).

 

DAX - https://powerbi.tips/2017/11/creating-a-dax-calendar/

M (Query editor) - https://powerpivotpro.com/2015/02/create-a-custom-calendar-in-power-query/

 

Then create an inactive relationship between your calendar table and your two columns and add the following measures:

 

Created count = CALCULATE(COUNT(DatesLog[Created on]);USERELATIONSHIP(DatesLog[Created on];DimDate[Date]))

Updated count = CALCULATE(COUNT(DatesLog[Updated on]);USERELATIONSHIP(DatesLog[Updated on];DimDate[Date]))

Add the month from the dates table on your x-axis and the measures on your values, this will give you the result below:

userrelation.png

 

Regards

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

2 REPLIES 2
MFelix
Super User
Super User

Hi @Anonymous,

 

You need to create a calendar table check the links below for a DAX and a M code option (just two examples).

 

DAX - https://powerbi.tips/2017/11/creating-a-dax-calendar/

M (Query editor) - https://powerpivotpro.com/2015/02/create-a-custom-calendar-in-power-query/

 

Then create an inactive relationship between your calendar table and your two columns and add the following measures:

 

Created count = CALCULATE(COUNT(DatesLog[Created on]);USERELATIONSHIP(DatesLog[Created on];DimDate[Date]))

Updated count = CALCULATE(COUNT(DatesLog[Updated on]);USERELATIONSHIP(DatesLog[Updated on];DimDate[Date]))

Add the month from the dates table on your x-axis and the measures on your values, this will give you the result below:

userrelation.png

 

Regards

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

Works perfectly, thanks!

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.