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
shaunguyver
Helper III
Helper III

Show multiple date fields on X-Axis of bar chart

I have a table of data that looks like this:

 

  • Opportunity 1 Date
  • Opportunity 1 Value (£)
  • Opportunity 2 Date
  • Opportunity 2 Value (£)
  • Opportunity 3 Date
  • Opportunity 3 Value (£)

I want to create a bar chart with X-Axis showing date of the opportunity, and Y-Axis showing the Value (£). Right now I can't do this, as the chart demands a single date value for X-Axis and a single value for Y-Axis. I want all the data shown on 1 chart, as if it was just 'Opportunity Date' and 'Opportunity Vale (£)'. 

 

I unpivoting the columns the only way to achieve this?

 

Thanks in advance for any help provided!

4 REPLIES 4
v-danhe-msft
Employee
Employee

Hi @shaunguyver,

Based on my test, you can refer to below steps:

1.I have entered some sample data to test for your problem like the picture below.

A.PNG2.

2.Create two calculated columns.

Data = CALCULATE(MIN([Column2]),FILTER(Table1,Table1[Column1]=EARLIER(Table1[Column1])))

Value = CALCULATE(MAX([Column2]),FILTER(Table1,Table1[Column1]=EARLIER(Table1[Column1])))

B.PNG

3.Create a bar chart and add the related columns, you can see the result.

C.PNG

You can also download the PBIX file to have a view.

https://www.dropbox.com/s/yh9yfb8i64f9rdf/Show%20multiple%20date%20fields%20on%20X-Axis%20of%20bar%2...

 

Regards,

Daniel He

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

Hi Daniel,

 

Thanks so much for your reply. However my query table isn't set out like your first pic above, instead it's set out like this:

 

  • Opportunity 1 Date
  • Opportunity 1 Value (£)
  • Opportunity 2 Date
  • Opportunity 2 Value (£)
  • Opportunity 3 Date
  • Opportunity 3 Value (£)

Each bullet point represent a column in the query table. I have tried unpivoting it but it doesn't seem to work (it just puts the column headers in the values all the way down)

Hi @shaunguyver,

Based on my test, if your data is like the picture below.

1.PNG

You could use the “Transpose” function to transpose your data, than you can use the ways I posted before.

2.PNG

 

Regards,

Daniel He

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

Hi,

 

Thanks again for your reply - that's not what my data looks like. It looks like the pic below.

 

How can I transpote these columns, so that my end result is:

 

  • Column A - Opportunity Date (all opportunity dates in this column)
  • Column B - Approx Value (all 'opportunity approx' values in this column)

 

Thanks in advance

 

screenshot.png

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.