Forum Discussion

panipat1990's avatar
panipat1990
Helper III
8 years ago

How to make max_date variable in query editator.

Dear Team,

 

i am new in ppower bi.I stuck a requirement. i used another bi tool.Where i made variable in backend.

And used Below Written condition=

Where Date=Date(Floor('$(vMax_Date)'),'DD/MM/YYYY')
Or
Date=Date(Floor('$(vMax_Date)'-1),'DD/MM/YYYY')
Or
Date=Date(Floor(WeekStart('$(vMax_Date)')),'DD/MM/YYYY')
Or
Date=Date(Floor(WeekStart('$(vMax_Date)',-1)),'DD/MM/YYYY')
Or
Date=Date(Floor(MonthEnd('$(vMax_Date)',-1)),'DD/MM/YYYY')
Or
Date=Date(Floor(MonthEnd('$(vMax_Date)',-2)),'DD/MM/YYYY')
Or
Date=Date(Floor(MonthEnd('$(vMax_Date)',-3)),'DD/MM/YYYY')
Or
Date=Date(Floor(MonthEnd(AddYears('$(vMax_Date)',-1))),'DD/MM/YYYY')
Or
Date=Date(Floor(YearStart('$(vMax_Date)',0,4)-1),'DD/MM/YYYY')
Or
Date=Date(Floor(YearStart(AddYears('$(vMax_Date)',-1),0,4)-1),'DD/MM/YYYY');

 

 

I Implemented same in power bi..But i am not able to make this.How i can..Kindly help me.

Would be appricate

11 Replies

  • v-yulgu-msft's avatar
    v-yulgu-msft
    Microsoft Employee

    Hi panipat1990,

     

    What is your desired result with above formula? Could you please illustrate your requirement with sample data? Besides, maybe you could try Query Parameter in Power BI.

     

    Regards,

    Yuliana Gu

    • panipat1990's avatar
      panipat1990
      Helper III

      I want to filter data from max date to last 4 month data..

       

      • panipat1990's avatar
        panipat1990
        Helper III

        Suppose in my table Date From 01-04-2016 to 25-05-2018

         

        i Want to pickup only Max_date to before 4 month ago not current date..Only Max date exixt in table.

        For this max date i made a variable  Max_Date=List.Max(Table[Sale])  Which is 25-05-2018

        I created same 4 month..But i want to filter data in above two variable how