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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
huguest
Advocate II
Advocate II

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
v-yuta-msft
Community Support
Community Support

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
v-yuta-msft
Community Support
Community Support

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

jthomson
Solution Sage
Solution Sage

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

Greg_Deckler
Super User
Super User

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

 

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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