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.
I have a base with 3 years of history and I would like to create a column with the same period of the previous year... Aiming to hit line by line (of the same date), without having to place the date column in the visual (the same table).
In short, it is taking the date without losing this mapping between the same dates and dates.
Can you help me with the best procedure to do creating this column?
Thanks!
Solved! Go to Solution.
Hi @DouglasRoubaud ,
Tty to use the following dax to create a new column:
previousvalue =
CALCULATE (
MAX ( 'Table'[Value] ),
FILTER (
ALL ( 'Table' ),
YEAR ( 'Table'[Date] )
= YEAR ( EARLIER ( 'Table'[Date] ) ) - 1
&& MONTH ( 'Table'[Date] ) = MONTH ( EARLIER ( 'Table'[Date] ) )
&& DAY ( 'Table'[Date] ) = DAY ( EARLIER ( 'Table'[Date] ) )
)
)
Get:
Final create visual:
Did I answer your question? Mark my post as a solution!
Best Regards
Lucien
Hi @DouglasRoubaud ,
Tty to use the following dax to create a new column:
previousvalue =
CALCULATE (
MAX ( 'Table'[Value] ),
FILTER (
ALL ( 'Table' ),
YEAR ( 'Table'[Date] )
= YEAR ( EARLIER ( 'Table'[Date] ) ) - 1
&& MONTH ( 'Table'[Date] ) = MONTH ( EARLIER ( 'Table'[Date] ) )
&& DAY ( 'Table'[Date] ) = DAY ( EARLIER ( 'Table'[Date] ) )
)
)
Get:
Final create visual:
Did I answer your question? Mark my post as a solution!
Best Regards
Lucien
@DouglasRoubaud you can create a measure to calc previous year value like below
Proud to be a Super User!
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
99 | |
93 | |
90 | |
71 | |
69 |
User | Count |
---|---|
228 | |
128 | |
117 | |
83 | |
82 |