mardi 18 juin 2019

PowerBI query doesn't work with date filter

I have this DAX:

Earned Daily =
VAR d = SELECTEDVALUE ( 'P6 Update'[Date] )
RETURN
IF (
    'Data for Pivot'[Date] <= d
        && 'Data for Pivot'[Act Rem] = "Actual Units"
        && 'Data for Pivot'[Type] = "Current",
    'Data for Pivot'[Value],
    0
)

'P6 Update'[Date] is attached to a Slicer (single select date dropdown).

I see that the date is being correctly set but when I try to use the date to filter it doesn't work.

If I do this:

Earned Daily =
IF (
    'Data for Pivot'[Date] <= DATE ( 2018, 4, 19 )
        && 'Data for Pivot'[Act Rem] = "Actual Units"
        && 'Data for Pivot'[Type] = "Current",
    'Data for Pivot'[Value],
    0
)

The data is filtered correctly.

What's the problem with the original code?

Aucun commentaire:

Enregistrer un commentaire