Forum Discussion
bgonen7
Helper I
4 years agoDAX Var for DSO
Can't get the second VAR to work - can someone help (if today's date is 8/24 then Day number should be 236) DSO = VAR Ratio = (([OpenAR]/[CY (YTDsales)])--this one works VAR DaysYTD = DAT...
- 4 years ago
Thanks for the quick feedback.
I was able to simplify a bit the second VAR (also, first VAR I had to add ()
DSO =
VAR Ratio = (([Open AR]/[CY(YTDsales)]))VAR DaysYTD = [Days YTD]// >>>note I created a measure called [Days YTD] = DATEDIFF(DATE(YEAR(TODAY()),1,1),TODAY(),DAY)
RETURN
Ratio*DaysYTD
davehus
Memorable Member
4 years agoHi bgonen7,
Seems the reference on the second part of the datediff could be your issue. It should probably be
DATEDIFF(DATE(YEAR('Calendar'[Date]),1,1),MAX('Calendar'[Date]),DAY)+1
Or use TODAY() either
Did I help you today? Please accept my solution and hit the Kudos button.