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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

How to create a shared axis(date) for two date columns

Hello all,

 

I have two date columns one is CreatedDate, the other is ClosedDate. 

You can think like it is a incident ticket, service ticket etc.

 

Format is as below:

 

 

 

 

 

powerbi_shared.JPG

 

 

 

 

 

 

 

 

 

 

 

 

 

I want to see them in a line graph or bar graph but in shared axis.

Same question is asked before but there are shared files in topic which are not available right now.

https://community.powerbi.com/t5/Desktop/quot-Shared-Axis-quot-for-two-date-columns-on-Clustered-Lin...

I tag them just in case they are around:

@MWitkin 

@Ashish_Mathur 

 

If I had to do it in excel, I would create all year-month-day combination in another sheet, then pivot those two columns to get counts and use vlookup to year-month-day sheet. But creating a new table just for that seems not so elegant also I don't know how to do it in PowerBI as well.

 

Can you please help?

Thanks for any idea or comment

8 REPLIES 8
jimminy
Frequent Visitor

Have you been able to find a solution to this? I am having the very same issue

Ashish_Mathur
Super User
Super User

Hi,

Your question is not clear.  Show the exact result in a Table format first.  From there we can build any visual that you want.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

@Ashish_Mathur 

As a result I need below visual:

toy1.JPG

 

I created a toy dataset as below to have above visual:

 

toy2.JPG

 

It is quite easy in excel but "Date" column above includes all dates which I don't have it in PowerBI.

"Created" is a count of created events, "Completed" is same as well.

 

In PowerBI dataset I don't have this structure. I have "Created" and "Completed" columns as only dates as below:

Each row represent a unique event.

 

powerbi_shared.JPG

 

I don't know if it is the only way, but as a result I need above bar chart - all dates should be in same axis and values are count of created-completed events on them-

 

Actually it is nearly same question that you answered around 3 years ago that I shared the link in topic, but I couldn't follow up since files are not available right now.

 

Thanks for your help

Greetings,

 

 

 

 

 

 

 

 

 

 

Hi,

What should appear in the column chart for March 13, 2020?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hello @Ashish_Mathur 

 

It should be 0 since no event occured on that day.

 

Thanks

Greetings

 

Hi,

This is the max i can do.  Download the file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

I assume when you say 2 columns, you mean 2 columns in the data table in your data model. Is that correct? If so, either unpivot the data on load and create 1 column with all the dates and a new column that identifies which date it is.. Alternatively you can create 2 relationships to your data table to the calendars table. The second will be inactive. Then write a measure that calls the inactive relationship for the second measure.

amitchandak
Super User
Super User

You can join with a common date dimension with one active and one inactive relation. You use userelation to activate the inactive one.

 

Refer: https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.