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.
Dear all,
I am strugguling to compare different periods of time.
I would like compare values from different periods of time, in order to visualize esaier, I would like use a line chart adn for each period of time share the same origin at the line chart.
Any idea how could I do it?
I put a picture to shown the idea. In the picture there are 6 cycles that I would like put all together in a line chart , with the same origin at X axis.
Any idea or solution , it will be apreciated.
Regards
The original data table is something like this:
Time | Value |
30/09/2014 0:00 | 0,15021051 |
01/10/2014 0:00 | 0,15194218 |
02/10/2014 0:00 | 0,16627039 |
03/10/2014 0:00 | 0,15699187 |
04/10/2014 0:00 | 0,15448058 |
05/10/2014 0:00 | 0,16861516 |
06/10/2014 0:00 | 0,18285625 |
07/10/2014 0:00 | 0,18062967 |
08/10/2014 0:00 | 0,1817147 |
11/10/2014 0:00 | 0,1834853 |
17/10/2014 0:00 | 0,17345996 |
18/10/2014 0:00 | 0,17069541 |
19/10/2014 0:00 | 0,17165352 |
20/10/2014 0:00 | 0,17774116 |
21/10/2014 0:00 | 0,17316929 |
Solved! Go to Solution.
Hi @Muertepelá ,
If say, you want to compare the lines by year, you can put year to the legend field and remove it from x-axis.
Proud to be a Super User!
@Muertepelá , You can plot two-period together on a line chart, for that the compared period should be trailing measure.
Like you can plot a YTD and LYTD where LYTD will appear on the same range as you YTD. Or you can have a trailing measures. This measure can 1 day, 1month 5 days , 7 days , 1 year, 2 years behind. You can configure and will appear along with your main measure. This work beast with a date calendar
Examples
YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(('Date'[Date]),"12/31"))
This Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD((ENDOFYEAR('Date'[Date])),"12/31"))
Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))
Last YTD complete Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(ENDOFYEAR(dateadd('Date'[Date],-1,Year)),"12/31"))
Last to last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-2,Year),"12/31"))
Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Year))
Year + 3 week behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd(dateadd('Date'[Date],-1,Year),-21,Day))
55 weeks behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],365+12,Day))
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 @Muertepelá ,
If say, you want to compare the lines by year, you can put year to the legend field and remove it from x-axis.
Proud to be a Super User!
You need a date table, then you drop the Year into the X Axis and it will allow you to see the months overlapping. Date tables are explained here. Instructions for creating a date table in Power Query can be found here. That date table will automatgically expand as your data does.
If you need additional help, we'd need some data, preferably a PBIX file to pay with that has dummy data in it.
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingCovering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
97 | |
85 | |
68 | |
59 |
User | Count |
---|---|
150 | |
120 | |
99 | |
87 | |
68 |