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.
Dear ,
i have data: Month and Date(measures) like:
Date(measures)=max(table[Date])
Month | Date(Measures) |
Jan | 10/1/2024 |
Feb | 20/2/2024 |
March | 11/3/2024 |
April | 10/4/2024 |
May | |
Jun | 19/06/2024 |
how can i get previous date like:
Month | Measures Pre |
Jan | 01/01/2024 |
Feb | 10/1/2024 |
March | 20/2/2024 |
April | 11/3/2024 |
May | |
Jun | 10/4/2024 |
Solved! Go to Solution.
Hi @Jyaulhaq, you can achieve the desired result using the following calcualtion:
Measures Pre =
VAR _CurrentDate = SELECTEDVALUE( 'Table'[Date] ) //get the current date
VAR _GlobalMin = //get the global minimum
CALCULATE(
MIN( 'Table'[Date] ),
ALL( 'Table' ) //to remove impact of any other column from the same table
)
VAR _PrevDate = //PrevDate
CALCULATE(
MAX( 'Table'[Date] ),
ALL( 'Table' ), //to remove impact of any other column from the same table (such as "Month")
'Table'[Date] < _CurrentDate
)
RETURN
IF(
_CurrentDate = _GlobalMin, //so the first row is selected
DATE( YEAR( TODAY() ), 1, 1 ), //the date you need
_PrevDate
)
Here is the output:
Have a great day!
Hi @Jyaulhaq, you can achieve the desired result using the following calcualtion:
Measures Pre =
VAR _CurrentDate = SELECTEDVALUE( 'Table'[Date] ) //get the current date
VAR _GlobalMin = //get the global minimum
CALCULATE(
MIN( 'Table'[Date] ),
ALL( 'Table' ) //to remove impact of any other column from the same table
)
VAR _PrevDate = //PrevDate
CALCULATE(
MAX( 'Table'[Date] ),
ALL( 'Table' ), //to remove impact of any other column from the same table (such as "Month")
'Table'[Date] < _CurrentDate
)
RETURN
IF(
_CurrentDate = _GlobalMin, //so the first row is selected
DATE( YEAR( TODAY() ), 1, 1 ), //the date you need
_PrevDate
)
Here is the output:
Have a great day!
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 | |
84 | |
66 | |
62 | |
60 |
User | Count |
---|---|
197 | |
118 | |
108 | |
78 | |
69 |