The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I am trying to create a graph which displays number of vendors selling x number of units in separate lines to show how sales are changing monthly. I can't get the data to display in a single graph, power bi keeps splitting it off into individual gaphs. Units sold on the X axis and number of vendors on the y axis.
I have the following data of units sold by number of vendors each month:
Units Sold | APR | MAR | FEB |
0 | 0 | 0 | 0 |
30 | 900764 | 714575 | 605772 |
60 | 642 | 110 | 0 |
90 | 225 | 33 | 0 |
120 | 111 | 23 | 0 |
150 | 107 | 15 | 0 |
180 | 88 | 17 | 0 |
Can anyone advise how to get this to display as a single graph with separate lines for each month? All help is appreciated, thanks.
Solved! Go to Solution.
Hi @Field-smith
Is the data in your table formatted as a Pivot as you are showing it? You can create separate measures, but it isn't sustainable. You will need to unpivot your data. What is the Units Sold column? Are these the type of units or is it a range? I will ignore this column for the moment.
In Power Query. Please do the following
if [Attribute] = "Jan" then 01/01/2024 else
if [Attribute] = "Feb" then 01/02/2024 else
if [Attribute] = "Mar" then 01/03/2024 else .....Finish for the year
if [Attribute] = "Jan" then "01/01/" & TextFrom.Number([Year])
You can build out your date to Months, Year etc.. There is plenty of documenation online to show you how to do this
Hope this helps
Joe
Proud to be a Super User! | |
Date tables help! Learn more
Hi @Field-smith
Do you want something like this??
You have to pivot your table so that all your month will come under single column.
Hi @Field-smith
Do you want something like this??
You have to pivot your table so that all your month will come under single column.
Hi @Field-smith
Is the data in your table formatted as a Pivot as you are showing it? You can create separate measures, but it isn't sustainable. You will need to unpivot your data. What is the Units Sold column? Are these the type of units or is it a range? I will ignore this column for the moment.
In Power Query. Please do the following
if [Attribute] = "Jan" then 01/01/2024 else
if [Attribute] = "Feb" then 01/02/2024 else
if [Attribute] = "Mar" then 01/03/2024 else .....Finish for the year
if [Attribute] = "Jan" then "01/01/" & TextFrom.Number([Year])
You can build out your date to Months, Year etc.. There is plenty of documenation online to show you how to do this
Hope this helps
Joe
Proud to be a Super User! | |
Date tables help! Learn more