Forum Discussion
Wrong calculation using date and text filter
- 2 years ago
Hi esbertl,
The references to a date column in your measure should now reference the new date dimension table. 🙂
ValueOnDate = CALCULATE ( SUM ( testvalues[Value] ), FILTER ( ALL ( 'Calendar'[Date] ), 'Calendar'[Date] <= MAX ( 'Calendar'[Date] ) ) )
----------------------------------
If this post helps, please consider accepting it as the solution to help other members find it quickly. Also, don't forget to hit that thumbs up and subscribe! (Oh, uh, wrong platform?)P.S. Need a more in-depth consultation for your Power BI data modeling or DAX issues? Feel free to hire me on Upwork or DM me directly on here! I would love to clear up your Power BI headaches.
Thank you Wilson for the quick answer!
In fact, with the help of the table, the strange calculation behavior is gone, unless I use the date table in the filter.
The basic idea of the filter on the date is to display only a certain section of the data. However, if I now select 02.01. as the start date, the values before 01.01. are missing from the total. I assume that I have to adjust my measure. Do you have any hints as to how the measure should look?
Hi esbertl,
The references to a date column in your measure should now reference the new date dimension table. 🙂
ValueOnDate =
CALCULATE (
SUM ( testvalues[Value] ),
FILTER (
ALL ( 'Calendar'[Date] ),
'Calendar'[Date] <= MAX ( 'Calendar'[Date] )
)
)
----------------------------------
If this post helps, please consider accepting it as the solution to help other members find it quickly. Also, don't forget to hit that thumbs up and subscribe! (Oh, uh, wrong platform?)
P.S. Need a more in-depth consultation for your Power BI data modeling or DAX issues? Feel free to hire me on Upwork or DM me directly on here! I would love to clear up your Power BI headaches.