Forum Discussion
problem with sum values with dates
- 6 years ago
Hi Anonymous ,
We can create a measure and use it in visual filter to meet your requirement:
IsOneMoreDay = IF ( SELECTEDVALUE ( 'Table'[Date].[MonthNo] ) = MONTH ( CALCULATE ( MAX ( 'Table'[Date] ), FILTER ( ALLSELECTED ( 'Table' ), YEAR ( 'Table'[Date] ) = 2019 ) ) ) && SELECTEDVALUE ( 'Table'[Date].[Day] ) > DAY ( CALCULATE ( MAX ( 'Table'[Date] ), FILTER ( ALLSELECTED ( 'Table' ), YEAR ( 'Table'[Date] ) = 2019 ) ) ) + 1, -1, 1 )
If it doesn't meet your requirement, Please show the exact expected result based on the Tables that we have shared.
Best regards, - 6 years ago
Hi Anonymous ,
First of all, we suggest you to delete the shared link if it contain any confidential information or real data.
Please try to use the following measure , and the result should be following if we put the month column into the table visual:
IsOneMoreDay = VAR MaxDayOf2019 = MAXX ( FILTER ( SUMMARIZE ( ALLSELECTED ( 'Tabla' ), 'Tabla'[Fecha], "2019", [Vta_rtl19sd] ), [2019] + 0 <> 0 ), [Fecha] ) RETURN IF ( OR ( SELECTEDVALUE ( 'Tabla'[Fecha].[NroMes] ) > MONTH ( MaxDayOf2019 ), AND ( SELECTEDVALUE ( 'Tabla'[Fecha].[NroMes] ) = MONTH ( MaxDayOf2019 ), SELECTEDVALUE ( 'Tabla'[Fecha].[Día] ) > DAY ( MaxDayOf2019 ) + 1 ) ), -1, 1 )
Best regards,
In 2019 measure filter for max date +1
Final 2019 =
Var _Max = max(date[date])+1
return
calculate(sum([2019]),filter(date[date]<=_Max) Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-trend/ba-p/882970
https://community.powerbi.com/t5/Community-Blog/Power-BI-Working-with-Non-Standard-Time-Periods/ba-p/881739
https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601