Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hello ,
Is it possible in power BI to compare automaticaly between N and N-1 year;
for example I want to obtain 2 curve in the same graph automatically ( one for 2017 and one for 2018 )
DATE | SUM |
06-oct-18 | 5 |
07-oct-18 | 2 |
06-oct-17 | 1 |
07-oct-17 | 5 |
thanks in advance
Solved! Go to Solution.
Hey,
yes it's possible to achieve this, but maybe not as simple as you might think 🙂
First I created a dedicated Calendar table (it's always a good idea to have a dedicated Calendar table in your data model) using this DAX statement:
Calendar = ADDCOLUMNS( CALENDAR("2017-01-01", "2018-12-31") ,"Year", YEAR(''[Date]) ,"Month Day", FORMAT(''[Date],"MM-DD") )
This is a very simple Calendar table, it just contains a date column, a Year column (this column will be used in the legend field of the line chart) and the "Month Day" (used as x-axis).
Then I created a relationship between both tables like so:
This allows to create a line chart like so:
Hopefully, this is what you are looking for!
Regards,
Tom
Do you know how to create a dynamic measure for trailing 3 months? For example, in November, it would calculate Aug, Sept, Oct..... and in Dec, it would calculate Sept, Oct, Nov.
Thanks!!!
Hey,
yes it's possible to achieve this, but maybe not as simple as you might think 🙂
First I created a dedicated Calendar table (it's always a good idea to have a dedicated Calendar table in your data model) using this DAX statement:
Calendar = ADDCOLUMNS( CALENDAR("2017-01-01", "2018-12-31") ,"Year", YEAR(''[Date]) ,"Month Day", FORMAT(''[Date],"MM-DD") )
This is a very simple Calendar table, it just contains a date column, a Year column (this column will be used in the legend field of the line chart) and the "Month Day" (used as x-axis).
Then I created a relationship between both tables like so:
This allows to create a line chart like so:
Hopefully, this is what you are looking for!
Regards,
Tom
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Ask questions in Eventhouse and KQL, Eventstream, and Reflex.
User | Count |
---|---|
86 | |
82 | |
64 | |
63 | |
56 |
User | Count |
---|---|
171 | |
113 | |
110 | |
73 | |
73 |