Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
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!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
86 | |
81 | |
53 | |
37 | |
35 |