Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Hi All!!!
I want to use something like this in a measure, not in calculated calumm because of the context, i want to get de vale only in de max of dFecha (date)
Solved! Go to Solution.
You may modify the measure like pattern below:
DiasPendientes =
CALCULATE (
    IF (
        CALCULATE ( MAX ( FactProveedores[FechaCobro] ); ALL ( FactProveedores ) )
            > CALCULATE ( MAX ( dFechas[Fecha] ); ALL ( dFechas ) );
        DATEDIFF (
            CALCULATE ( MAX ( FactProveedores[Fecha] ); ALL ( FactProveedores ) );
            CALCULATE ( MAX ( dFechas[Fecha] ); ALL ( dFechas ) );
            DAY
        );
        BLANK ()
    );
    FactProveedores[IdOrigen] = -3
)
Community Support Team _ Jimmy Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
You may modify the measure like pattern below:
DiasPendientes =
CALCULATE (
    IF (
        CALCULATE ( MAX ( FactProveedores[FechaCobro] ); ALL ( FactProveedores ) )
            > CALCULATE ( MAX ( dFechas[Fecha] ); ALL ( dFechas ) );
        DATEDIFF (
            CALCULATE ( MAX ( FactProveedores[Fecha] ); ALL ( FactProveedores ) );
            CALCULATE ( MAX ( dFechas[Fecha] ); ALL ( dFechas ) );
            DAY
        );
        BLANK ()
    );
    FactProveedores[IdOrigen] = -3
)
Community Support Team _ Jimmy Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @FranMullor
it's absolutely unclear what do you want. if try to decomposite it could look like
DiasPendientes =
var _maxFechaCobro = CALCULATE(MAX(FactProveedores[FechaCobro]);FactProveedores[IdOrigen]=-3)
var _maxFecha = CALCULATE(max(dFechas[Fecha]))
RETURN
IF(_maxFechaCobro > _maxFecha; _maxFechaCobro - _maxFecha; BLANK())You need to force a row context in measure
Refer my blog on that : https://community.powerbi.com/t5/Community-Blog/Decoding-Direct-Query-in-Power-BI-Part-2-Date-Differ...
 
					
				
				
			
		
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
 
            | User | Count | 
|---|---|
| 84 | |
| 49 | |
| 36 | |
| 31 | |
| 30 |