Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Greeting Guys ,
i want to add a 2 calculated column into my Date Table called "ContainInYTD" and "ContainInLYTD"
This column equals True if the row belong to the YTD and False if not . (Based on the current date)
Exemple :
since we are in march ,the rows from january to march equals to true the others rows equal to false . is it possible ?
Thanks all in advance 😊. ( i can explain more if needed )
@Anonymous,
Try these calculated columns:
ContainInYTD =
VAR vToday =
TODAY()
VAR vYear =
YEAR ( vToday )
VAR vResult =
IF ( DIM_DATE[DATE] <= vToday && DIM_DATE[YEAR] = vYear, 1, 0 )
RETURN
vResult
ContainInLYTD =
VAR vToday =
TODAY ()
VAR vYear =
YEAR ( vToday )
VAR vMonth =
MONTH ( vToday )
VAR vDay =
DAY ( vToday )
VAR vResult =
IF (
DIM_DATE[DATE]
<= DATE ( vYear - 1, vMonth, vDay )
&& DIM_DATE[YEAR] = vYear - 1,
1,
0
)
RETURN
vResult
Proud to be a Super User!
User | Count |
---|---|
117 | |
75 | |
62 | |
50 | |
44 |
User | Count |
---|---|
174 | |
125 | |
60 | |
60 | |
57 |