Forum Discussion
YTD for different date format without Date column
- 10 months ago
Hi Anonymous
I would use a date equivalent of the date mix key (date for daily and end of month of monthly) and run the ytd calculation using that column. Example:
YTD Value = CALCULATE ( [value], FILTER ( ALLEXCEPT ( datesdim, datesdim[mix type] ), datesdim[date equivalent] <= MAX ( datesdim[date] ) && datesdim[year] = MAX ( datesdim[year] ) ) )If this doesn't work, please provide a workable sample data (not an image), your expected result from the same sample data and your reasoning behind. You may post a link to Excel or a sanitized copy of your PBIX stored in the cloud.
- 10 months ago
Hi Anonymous ,
Assuming your relationship:- fact_general_actual[mix_date_key] β dim_bridge_date[mix_date_key]
Make sure you have actual date field in dim_bridge_date
Create a measure for YTD:-
Actual YTD =
VAR CurrentYear = SELECTEDVALUE(dim_bridge_date[year])
VAR CurrentDate = MAX(dim_bridge_date[Date])
RETURN
CALCULATE(
SUM(fact_general_actual[value]),
FILTER(
ALL(dim_bridge_date),
dim_bridge_date[year] = CurrentYear &&
dim_bridge_date[Date] <= CurrentDate
)
)π I hope this solution helps you unlock your Power BI potential! If you found it helpful, click 'Mark as Solution' to guide others toward the answers they need.
π‘ Love the effort? Drop the kudos! Your appreciation fuels community spirit and innovation.
π As a proud SuperUser and Microsoft Partner, weβre here to empower your data journey and the Power BI Community at large.
π Curious to explore more? [Discover here].
Letβs keep building smarter solutions together!
Hi Anonymous ,
Assuming your relationship:- fact_general_actual[mix_date_key] β dim_bridge_date[mix_date_key]
Make sure you have actual date field in dim_bridge_date
Create a measure for YTD:-
Actual YTD =
VAR CurrentYear = SELECTEDVALUE(dim_bridge_date[year])
VAR CurrentDate = MAX(dim_bridge_date[Date])
RETURN
CALCULATE(
SUM(fact_general_actual[value]),
FILTER(
ALL(dim_bridge_date),
dim_bridge_date[year] = CurrentYear &&
dim_bridge_date[Date] <= CurrentDate
)
)
π I hope this solution helps you unlock your Power BI potential! If you found it helpful, click 'Mark as Solution' to guide others toward the answers they need.
π‘ Love the effort? Drop the kudos! Your appreciation fuels community spirit and innovation.
π As a proud SuperUser and Microsoft Partner, weβre here to empower your data journey and the Power BI Community at large.
π Curious to explore more? [Discover here].
Letβs keep building smarter solutions together!