Forum Discussion

blaj's avatar
blaj
Icon for Helper I rankHelper I
2 years ago
Solved

Measure changes when published to from Desktop to Fabric

I have a measure that gets thrown off misteriously when I publish from .pbix to Fabric. I checked the filter icons in both places and no additional Fabric filters are being applied. I updated Power B...
  • blaj's avatar
    2 years ago

    For some reason Power BI desktop did not take into account my incorrect filter context which was supposed to be at the Monthly level. My measure filtered at the Daily level. Desktop still displayed it at the Monthly level while Fabric did at the Daily level...

     

    Seems like  a bug in filter context between Desktop & Fabric, unless I am missing something.

     

    previous measure filter context:

     
    var vtable =
        FILTER(
                VALUES(DATETABLE[Date]),  
                DATETABLE[Date] <= MAX(DATETABLE[Date])
            )

    var result =
        SUMX(vtable,[A] - [B] - [C])

    RETURN
    result
        result
     
    new measure:
        CALCULATE(
            [A] - [B] - [C],
            DATETABLE[Date] <= MAX(DATETABLE[Date])
        )
     
    CALCULATE just works better/simpler sometimes 😊