cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
huguest Member
Member

Chart from two Date fields

Hello,

I want to create a bar chart that presents the count of records having a given date in two separate date fields (Date1 and Date2) with a date x-axis.  I also need to be able to filter by country and/or region.

 

Here is a sample dataset and desired chart:

 

CountryRegionDate1Date2
CanadaAmericas31-Oct-1831-Oct-18
USAAmericas31-Oct-1831-Dec-18
ChinaAsia Pacific30-Jun-1831-Jul-18
IndiaAsia Pacific30-Sep-1830-Sep-18
FranceEurope30-Sep-1831-Oct-18
GermanyEurope31-Jul-1830-Nov-18
SpainEurope30-Nov-1831-Dec-18
AustraliaAsia Pacific31-Aug-1830-Sep-18

 

chart.png

 

Researched and tried various things without success 😞

 

Thank you!

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Chart from two Date fields

Hi huguest,

 

Click edit queries-> Transform-> click on column Date1 and Date2-> click Unpivot Columns, the result is like below:

Capture.PNG 

 

Then you can drag country column to value field, Date column as x-axis, legend column as legend.

2.PNG 

 

Regards,

Jimmy Tao

View solution in original post

3 REPLIES 3
Super User
Super User

Re: Chart from two Date fields

I'm not super clear on what you are going for here but perhaps it is similar to one of these two Quick Measures?

https://community.powerbi.com/t5/Quick-Measures-Gallery/Open-Tickets/m-p/409364
https://community.powerbi.com/t5/Quick-Measures-Gallery/Periodic-Billing/m-p/409365

 

 


I have book! Learn Power BI from Packt


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

Proud to be a Datanaut!

jthomson New Contributor
New Contributor

Re: Chart from two Date fields

Just do some pivoting in Power Query so you've got four columns - country, region, date type and date, then make a couple of measures counting the instances of 1 and 2 in your date type column

Community Support Team
Community Support Team

Re: Chart from two Date fields

Hi huguest,

 

Click edit queries-> Transform-> click on column Date1 and Date2-> click Unpivot Columns, the result is like below:

Capture.PNG 

 

Then you can drag country column to value field, Date column as x-axis, legend column as legend.

2.PNG 

 

Regards,

Jimmy Tao

View solution in original post

Helpful resources

Announcements
New Kudos Received Badges Coming

New Kudos Received Badges Coming

Kudos to you if you earned one of these! Check your inbox for a notification.

Microsoft Implementation for Communities Wins Award

Microsoft Implementation for Communities Wins Award

Learn about the award-winning innovation that was implemented across Microsoft’s Business Applications Communities.

Power Platform World Tour

Power Platform World Tour

Find out where you can attend!

Top Kudoed Authors (Last 30 Days)
Users online (2,722)