Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello All,
I have a list of Products and their prices per month from 2010 till 2020 Dec like below.
Date | AlPT | AlPUST | AlAEURT |
Jan-10 | 1.5 | 2.5 | 1.9 |
Feb-10 | 2 | 2.8 | 2.5 |
... | |||
Dec-20 | 9 | 7.9 | 5.5 |
1)How do i get a line chart if i want to compare from maybe may 2014 to june 2015.The plot happens per month then i lose sight of year And if i include year as well in Axis then it just sums the year up.
2)If i upload the file as above format it becomes difficult if i want to have a filter on the product and date range as the products are in different columns.Is there a way to solve this.
Thanks
Solved! Go to Solution.
@Anonymous
First, unpivot the table
https://radacad.com/pivot-and-unpivot-with-power-bi
from month Create a date
Date = "1-" & table[Month] based on you format
Join with a date calendar table
There you can create month year and month year sort column
Month Year = format(date[date],"MMM-YYYY")
Month Year Sort = format(date[date],"YYYYMM")
Use those
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/
Hi @Anonymous
amitchandak has pointed the right direction to solve your problems.
If you have any problem inplementing it on your side, please don't hesitate to ask here.
Hi @Anonymous ,
You can try using a Slicer to select the year and month specific ranges.
In order to lose sight of the year when plot needs to be seen by month and vise versa, Drill down/Drill Up feature in line chart would automatically suffice the need using date hierarchy.
Hope this helps!
Thanks!
@Anonymous
First, unpivot the table
https://radacad.com/pivot-and-unpivot-with-power-bi
from month Create a date
Date = "1-" & table[Month] based on you format
Join with a date calendar table
There you can create month year and month year sort column
Month Year = format(date[date],"MMM-YYYY")
Month Year Sort = format(date[date],"YYYYMM")
Use those
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/
hello @amitchandak
Thanks for the unpivot solution that was great.Now i get teh products in a slicer.Then i used the below
If you make YYYYMM datatype as a number then you can get between. But you may not be able to control value. Like it might allow 202013.
@Anonymous , Hope I got it correctly ?
Hello @amitchandak
Yes when i convert it to whole numnber then i se the issue the slicer can get any number in between 20101(say january) to 202012(2020 dec) like 188477.Could you please explain on hte date solution then,maybe i need to get that in.
Thanks
Hello @amitchandak ,
I guess it is solved.The Unpivot was the best part and then not getting it in the Axis was a small visualization thing i guess.I had hte date format in good one itself.I changed the X-aXIS Type to 'categorical' and it shows all the months and year.Thanks a lot.
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
71 | |
70 | |
43 | |
31 | |
26 |
User | Count |
---|---|
89 | |
49 | |
44 | |
38 | |
37 |