datesytd
5 TopicsHow can we provide the year end string dynamically in TOTALYTD & DATESYTD?
Hi .., I am facing the issue of specifying the different yearends in TOTALYTD/DATESYTD functions. I require that according to the Site & Phase selected, the yearend be changed accordingly for the calculations. I have written the following dax which is throwing an error. Can anybody suggest a solution to this? C_RAG% YTD = var v_yearend = SELECTEDVALUE(Formulae[Contract_End]) Var Validselection = ISFILTERED('Dim_Sites'[Site & Phase]) && HASONEVALUE('Dim_Sites'[Site & Phase]) RETURN //TOTALYTD( [Actual C_RAG% Static] , ALL('Calendar'[Date]),ALL('Calendar'),v_yearend) IF(Validselection,CALCULATE([C_RAG%],ALL('Calendar'), DATESYTD('Calendar'[Date],v_yearend))) There are around 20 distinct values for Site & Phase and hence 20 different calendars followed. I do not want to hardcode it.867Views0likes3CommentsProblem with DatesYTD - It does not accumulate when a field has no value
Turnover Qtd Demitidos Ate Mes = var Retorno = CALCULATE ( count(fatoAtivo[id]), fatoAtivo[TipoDado]=2, fatoAtivo[Demitido]=True, DATESYTD(calendario[Data]) ) return if(ISBLANK(retorno),0,Retorno) I made the measurement above, with the aim of accumulating the number of records from the beginning of the year to the selected month, if I put it on a card it works normally, it brings the total correctly, however if I put it in a matrix opened by the "CargoPiramide" field , and in a given month there is no value for this field, the accumulation for that month is not performed. For example, in the month of Jan'2023 there were 3 directors dismissed, in the month of Feb'2023 none, when I select the month of Feb'2023, the value of the director in the matrix is zeroed, and the right thing to do was to come 3, which is the amount that it had in the previous month, but the current month, as the current month has no value, so the result should be 3, when information appears on the following month, the sum is correct, the problem is only when a month does not give you information, so that month does not appear the accumulated until it, it is simply zeroed. How to resolve this to measure?649Views0likes3CommentsInclude Previous Year last day amount to current YTD amount
Hi All, I have to ask for a measure to include 12/31 days amount added into current year YTD amount. Date Amount YTD Amount CAL YTD Amount 12/31/2021 2 2 2 + (Amount from 12/31/2020) 12/1/2022 1 1 3 12/2/2022 1 3 12/3/2022 2 3 5 . . . 12/29/2022 3 5 12/30/2022 2 5 7 12/31/2022 2 7 9 1/1/2023 2 2 4 If you see 1/1/2023 CAL YTD amount it is adding 12/31/2022 Amount of 2 and then 1/1/2023 amount of 2. YTD Amount: CALCULATE(SUM(Amount), DATESYTD(Date)) I tried below Dax exp for CAL YTD Amount but not calculating correctly. CAL YTD Amount: CALCULATE(SUM(Amount), DATESYTD(IF(MONTH(Date) = 12 && DAY(Date) = 31, Date + 1, Date)))Solved718Views0likes2CommentsDATESYTD not working on SWITCH with logical test based on time
I am encountering a problem with a DATESYTD on a time based SWITCH measure that I am writing. Situation: - I have a measure for my Actuals - I have a measure for my Forecast - I have a SWITCH measure that looks at actuals when the week is in the past (based on the WeekIndex_Nr), and at the forecast when the week is in the future - I want to create a measure that calculates the YTD based on the SWITCH measure Used measures: Actuals = SUM( Fact_Sales[Quantity] ) Forecast = SUM( Fact_Forecast[Quantity] ) Switch ACT/FCST = SWITCH( TRUE() , SELECTEDVALUE( Dim_Date[WeekIndex_Nr] ) >= 0 , [Forecast] , [Actuals] ) YTD on Switch ACT/FCST = CALCULATE( [Switch ACT/FCST] , DATESYTD(Dim_Date[Date] ) ) Problem: I use the DATESYTD measure to calculate the YTD value. Usually this always works, but when I apply it on the SWITCH as described above, the accumulated values are ONLY those of the Forecast, and not of the Actuals. Result: Can anyone explain why this is happening and how to solve it? Thanks a lot!Solved698Views0likes2CommentsTime intelligence methods for hourly calculations
So, here is a measure that works just fine when I'm using the Daily calendar. What could be the possible directions for doing the same when using Hourly calendar? Cumulative sum = CALCULATE ( [Measure], CALCULATETABLE ( SAMEPERIODLASTYEAR ( DATESYTD ( 'Daily calendar'[Date], "31/03" ))))Solved989Views0likes3Comments