Forum Discussion

Arranafc19's avatar
Arranafc19
Icon for Helper IV rankHelper IV
7 years ago

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:

 

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.

 

 

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

    • Arranafc19's avatar
      Arranafc19
      Icon for Helper IV rankHelper IV

      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

       

       

      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