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
Arranafc19
Helper IV
Helper IV

Formatting data for use in Line Graph

 am working on a query, which I intend to use for a power bi Chart, however I can't quite tailor it in the format required.

I have a table, which is called sales which stores a list of car sales per dealer, with a date the car went on sale and the date it was actually sold.

I then have a query which gets the date difference between the two dates and calculates the difference in months between the date sold per sale and also the total number of sales.

My dataset is as follows:

Screen Shot 2019-06-10 at 22.20.06.png

 

What I hope to achieve from this is when I select a date range through a slicer , I want to be able to get a total number of cars where the sale start date is between those dates , and then a count per month of those cars that are sold. This will then provide me with a percentage of cars per month that have sold. See below for clearer idea of what is required.

 

Screen Shot 2019-06-10 at 22.12.15.png

 

My goal is to be able to plot this on a line graph to show the progression in percetage of sales per month.

 

Can someone advise me how to model this in Power Bi to show both the above table format and graph in Power Bi ?

2 REPLIES 2
v-frfei-msft
Community Support
Community Support

Hi @Arranafc19 ,

 

You can unpivot/ pivot your table in power query to have a try.

 

2.PNG

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Hi @v-frfei-msft 

 

This isn't quite what I was looking for , I actually don't think I was very clear in my explanation.

 

Basically I have the below dataset

 

Screen Shot 2019-06-10 at 22.20.06.png

 

Through the use of slicer for the sale start date and the dealer , I need to be able to group the month sold column and get a percentage of total sales per month. Not all records have a date sold so the idea is to get a percetnage per month of how many actually sold.

 

Hope this makes sense

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.