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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
AaronHL
Frequent Visitor

Clustered Column comparing count of dates in two columns from same table

I have two date columns in a table, "date1" and "date2". Not every row has both columns populated. I wish to be able to compare the count of those dates for each month/year using a clustered column visual. I'm unsure how I can do this.

 

I've tried using just "date1" as the x-axis and then putting both the count of "date1" and "date2" as the y-axis. This just leads to the "date1" columns in the visual to display the way I want, but "date2" columns in the visual just represent the count of rows where "date2" is populated for given "date1" date in the same row (and lots of "date2" just comes back as "blank" for the rows where "date1" is populated but "date2" isn't).

 

Any help would be appreciated.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@AaronHL , Join both date1 and date 2 to a common date table. Make sure dates do not have timestamp. One join will be inactive, which you can activate on measure using userelationship

 

Assume date 2 is inactive

calculate( SUM(Table[Amount]),USERELATIONSHIP ('Table'[date2], 'Date'[Date]))

 

Now use date from date on axis

 

Power BI: HR Analytics - Employees as on Date : https://youtu.be/e6Y-l_JtCq4
https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

https://radacad.com/userelationship-or-role-playing-dimension-dealing-with-inactive-relationships-in...

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

Your requirement is not clear.  Share data in a format that can be pasted in an MS Excel file and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
amitchandak
Super User
Super User

@AaronHL , Join both date1 and date 2 to a common date table. Make sure dates do not have timestamp. One join will be inactive, which you can activate on measure using userelationship

 

Assume date 2 is inactive

calculate( SUM(Table[Amount]),USERELATIONSHIP ('Table'[date2], 'Date'[Date]))

 

Now use date from date on axis

 

Power BI: HR Analytics - Employees as on Date : https://youtu.be/e6Y-l_JtCq4
https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

https://radacad.com/userelationship-or-role-playing-dimension-dealing-with-inactive-relationships-in...

I was hoping ot do this without creating a new table, but yah I think this is the only way it can be done. Thank you.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.