Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I want to use dynamically chosen Month # and Day # from a Fact table (or from the Date dimension table) for the YTD year-over-year comparison. For example, if the chosen date value is 2019-11-05 (or the chosen Month # = 11 and Day # = 5), I want to do the comparison like:
How should I do? Use Slicer for the selection? DATESYTD()? TotalYTD()?
@Anonymous ,
Generally, you may create a measure using dax like pattern below:
Result =
VAR Current_Year =
YEAR ( Table[Date] )
RETURN
CALCULATE (
SUM ( Table[Value] ),
FILTER (
ALLEXCEPT ( Table, Table[Date].[Year] ),
Table[Date]
<= DATE ( Current_Year, SELECTEDVALUE ( Date[Month] ), SELECTEDVALUE ( Date[Day] ) )
)
)
Community Support Team _ Jimmy Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If you have them choose a date in the slicer, you can use DAY to get the day and MONTH to get the month. Not sure I understand your question.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 59 | |
| 43 | |
| 42 | |
| 23 | |
| 17 |
| User | Count |
|---|---|
| 190 | |
| 122 | |
| 96 | |
| 66 | |
| 47 |