Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
Dear Community
I have a measure to calculate YTD numbers as follows:
Solved! Go to Solution.
Hi @Waseem ,
You're close in your approach, but the issue lies in how the filter is being applied within your DAX expression. Your original YTD measure [YTD-Rev-CoS] already performs a CALCULATE operation, and then you're wrapping that in a SUMX over a filtered table, which can lead to context issues and incorrect results. Instead, you should apply the filter directly within the CALCULATE function that defines the YTD measure. For example, revise the measure like this:
YTD-Revenue = CALCULATE(SUM('Model'[Value]), DATESYTD('New Date'[Date]), 'Model'[Cost Type] = "Revenue", ALLSELECTED('New Date'[Month])).
This ensures that the "Revenue" filter is applied at the same level as the time intelligence logic, maintaining proper context and yielding correct results. Wrapping an existing measure in a FILTER function post-calculation can sometimes break the intended evaluation context, especially with time functions like DATESYTD.
Hi @Waseem ,
You're close in your approach, but the issue lies in how the filter is being applied within your DAX expression. Your original YTD measure [YTD-Rev-CoS] already performs a CALCULATE operation, and then you're wrapping that in a SUMX over a filtered table, which can lead to context issues and incorrect results. Instead, you should apply the filter directly within the CALCULATE function that defines the YTD measure. For example, revise the measure like this:
YTD-Revenue = CALCULATE(SUM('Model'[Value]), DATESYTD('New Date'[Date]), 'Model'[Cost Type] = "Revenue", ALLSELECTED('New Date'[Month])).
This ensures that the "Revenue" filter is applied at the same level as the time intelligence logic, maintaining proper context and yielding correct results. Wrapping an existing measure in a FILTER function post-calculation can sometimes break the intended evaluation context, especially with time functions like DATESYTD.
User | Count |
---|---|
65 | |
60 | |
47 | |
33 | |
32 |
User | Count |
---|---|
85 | |
75 | |
56 | |
50 | |
45 |