Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

M for Calculated Column in Direct Query Mode

Hello Power BI Gurus,    I have a bit of a issue that I am hoping to get some help on.    Issue: I am creating a report from our on prem SQL Server (using the enterprise data gateway) in Direct ...
  • v-yulgu-msft's avatar
    7 years ago

    Hi Anonymous ,

     

    Is this your desired result?

    NewColumn =
    IF (
        Forecasts[ForecastID]
            = CALCULATE (
                MAX ( Forecasts[ForecastID] ),
                ALLEXCEPT ( Forecasts, Forecasts[FiscalYear], Forecasts[FiscalMonth] )
            ),
        TRUE (),
        FALSE ()
    )
    

     

    By the way, it is not possible to add custom column with M code in Direct Query Mode, so, you should use DAX instead.

     

    Regards,

    Yuliana Gu