Forum Discussion

ChromeMystic's avatar
ChromeMystic
Helper I
4 years ago
Solved

Can I create a lookup Table for Values between two dates in Powerquery?

I have solved this with DAX at the Moment but I would love to do it in PowerQuery, so I can create all my tables inside Dataflows. I got a table with our KPI Values as well as the Start and end date...
  • v-yanjiang-msft's avatar
    4 years ago

    Hi ChromeMystic ,

    According to your DAX formula, here's my PowerQuery solution.

    Create a custom column.

    = Table.SelectRows(sedKPI, 
        		(sedKPI) =>(sedKPI[ValidFrom] <= [Date]) and
           		(sedKPI[ValidTo]  >=  [Date]) and 
           		(sedKPI[KPI] = "KPIValue1")
            	)[Green]{0}

    I attach my sample below for reference.

     

    Best Regards,
    Community Support Team _ kalyj

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.