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
mccartanpat
Frequent Visitor

Plotting two date fields on one date axis

Hi Folks,

 

Hopefully someone can help me out here. Relatively new to PowerBI.

 

Am using the Salesforce case object where each record has an Open Date and Closed Date.

 

I want to plot the number of cases open vs closed over a period of months.

 

If I use either of the date fields as the axis then I will be limiting the other field by that date and as a result some records will be excluded.

 

What I think would work, if technically possible, would be to create a dynamic table that would automatically populate with the Case number, Date (open or closed depending on the source field), Flag.

 

Is it possible to insert a record with the Case number, Open Date, Flag of 'O' for all of the records with an open date populated?

Then insert a record with the Case number, Closed Date, Flag of 'C' for all of the records with the closed date populated?

 

So if the source looks like this: 

 

 

Source Table.jpg

The format I am looking to to dynamically populate is this:

 

Format Wanted.jpg

 

The result I want from PowerBI is similar to this:

 

Result.jpg

 

This will allow me to filter by Open/Closed date rather than the source Open Date, Closed Date and allow me to show cases that closed in a certain month even if they were opened before that date filter (I have filtered here to only show Oct and Nov)

 

Result Filter.jpg

 

Kind Regards,

 

Patrick.

1 ACCEPTED SOLUTION
v-chuncz-msft
Community Support
Community Support

@mccartanpat,

 

You may right click column [Case Number], then select Unpivot Other Columns in the Query Editor.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-chuncz-msft
Community Support
Community Support

@mccartanpat,

 

You may right click column [Case Number], then select Unpivot Other Columns in the Query Editor.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-chuncz-msft,

 

Excellent stuff, (sorry for the delay in responding I got distracted by something else!).

 

Thanks a million for taking the time to help me. That worked a treat for what I was trying to to.

 

Kind Regards,

 

Patrick.

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.