Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
I loaded factinternetsales from adventureworks2016 database into powerbi. created totalytd column using following dax formula.
TOTALYTD= TOTALYTD(sum(FactInternetSales[SalesAmount]),FactInternetSales[OrderDate].[Date])
the above dax is not working. please find the below screenshot.
Solved! Go to Solution.
Hi @SivaReddy ,
Try this formula.
Measure = CALCULATE(SUM('Table'[sales]),FILTER(ALLSELECTED('Table'),YEAR('Table'[date])=YEAR(SELECTEDVALUE('Table'[date]))&&'Table'[date]<=MAX('Table'[date])))
Best Regards,
Jay
Hi @SivaReddy ,
Try this formula.
Measure = CALCULATE(SUM('Table'[sales]),FILTER(ALLSELECTED('Table'),YEAR('Table'[date])=YEAR(SELECTEDVALUE('Table'[date]))&&'Table'[date]<=MAX('Table'[date])))
Best Regards,
Jay
Hi @SivaReddy ,
If you have calender table/date table which connected to FactInternetSales table then pass date column from calender/date table into totalytd function.
TOTALYTD ( SUM ( FactInternetSales[SalesAmount] ), Calender_table[Date] )or you can try below code:-
TOTALYTD =
CALCULATE (
SUM ( FactInternetSales[SalesAmount] ),
YEAR ( FactInternetSales[OrderDate] ) = YEAR ( NOW () )
)
Thanks,
Samarth
Best Regards,
Samarth
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
I used fulldatealternativekey of dimdate. Still I am not getting ytd. please find the below screenshot.
dax formula used is TotalYTD = TOTALYTD(sum(FactInternetSales[SalesAmount]),DimDate[FullDateAlternateKey].[Date])
What about below code?
TOTALYTD =
CALCULATE (
SUM ( FactInternetSales[SalesAmount] ),
YEAR ( FactInternetSales[OrderDate] ) = YEAR ( NOW () )
)
Best Regards,
Samarth
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.