Forum Discussion
Percentages without null values and Dates
- 1 year ago
Hello ponchibonos,
Thanks for sharing those examples.
I have reproduced your scenario in Power BI Desktop and confirmed that the output matches your expected results:For your reference, I’m attaching the .pbix file containing the working example so you can review the setup and DAX logic in detail.
Best Regards,
Ganesh singamshetty.
Hello ponchibonos,
Thanks for sharing those examples.
I have reproduced your scenario in Power BI Desktop and confirmed that the output matches your expected results:
For your reference, I’m attaching the .pbix file containing the working example so you can review the setup and DAX logic in detail.
Best Regards,
Ganesh singamshetty.
I made some modifications to the proposal of v-ssriganesh . It now works perfectly to meet the calculation requirements.
% Respuesta (Año Máximo y Filtro por Persona) =
VAR _SelectedYears = VALUES('Hoja1 (2)'[Year])
VAR _MaxYear = MAX('Hoja1 (2)'[Year]) // Solo el año máximo seleccionado
VAR _SumAnswered =
CALCULATE(
SUM('Hoja1 (2)'[Percentage result]),
KEEPFILTERS('Hoja1 (2)'[Year] = _MaxYear), // Respeta filtros externos (como Person)
REMOVEFILTERS('Hoja1 (2)'[Year]) // Elimina conflicto con ALLSELECTED
)
VAR _SumExpected =
CALCULATE(
SUM('Hoja1 (2)'[Percentage of each question]),
KEEPFILTERS('Hoja1 (2)'[Year] = _MaxYear),
KEEPFILTERS(NOT ISBLANK('Hoja1 (2)'[Percentage result])),
REMOVEFILTERS('Hoja1 (2)'[Year])
)
RETURN
DIVIDE(_SumAnswered, _SumExpected, 0) * 100
Thank you all.