Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hi everyone,
I'm contacting you because I have an issue with this measure:
VAR MaxDate=max('dim Fecha'[Fecha])
RETURN
CALCULATE(
CALCULATE([*Tratamientos Activos],
'fact Visitas'[Id Tipo Visita]<>"I",
filter('fact Prescripciones',[*Cumple_No_Cumple]="Cumple"),
'fact Visitas'[Dias entre visitas (Atributo)]<>0),
filter(ALL('dim Fecha'),'dim Fecha'[Fecha]<=MaxDate),
filter(ALLSELECTED('fact Prescripciones'),'a Measures ET'[*Tratamientos Activos]=1))
hi @Greg_Deckler !
It's a pitty but those links didn't help me. I'll be glad to try to explain it again:
We have this measure:
*PRUEBA ADH =
VAR MaxDate=max('dim Fecha'[Fecha])
RETURN
CALCULATE(
CALCULATE([*Tratamientos Activos],
'fact Visitas'[Id Tipo Visita]<>"I",
filter('fact Prescripciones',[*Cumple_No_Cumple]="Cumple"),
'fact Visitas'[Dias entre visitas (Atributo)]<>0),
filter(ALL('dim Fecha'),'dim Fecha'[Fecha]<=MaxDate),
filter(ALLSELECTED('fact Prescripciones'),'a Measures ET'[*Tratamientos Activos]=1))
@okusai3000 It's perfectly clear but see the second part of the post. Need sample data and expected output to recreate it, otherwise it is next to impossible to help you out.
@okusai3000 This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376
Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907
If that doesn't help, Sorry, having trouble following, can you post sample data as text and expected output?
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882
Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.