Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

Wanted to create parameters based on json extracted column

Hi Team,

 

I have extracted a column ( emaildate ) from JSON in power bi desktop  and i have created 2 parameters based on that ( From Date and To Date ) now i wanted to link From date and To Date in Advance editor. Could you please help me with m language code here ? as i dont have column emaildate avaialble in main data source. so i cant use  this query (  Select * from maindatasource where emaildate >= from date and emaildate <= todate ) in advance editor 

 

Thanks,

Shubham

1 Reply

  • dax's avatar
    dax
    Icon for Community Support rankCommunity Support

    Hi Anonymous , 

    You could set parameter and use parameter to filter it. You need to create two parameter s in "edit queries" and set filter like below

     

    let
        Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjIwMtA31DdUitWBckxROUbIHGOl2FgA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [date = _t]),
        #"Changed Type" = Table.TransformColumnTypes(Source,{{"date", type date}}),
        #"Filtered Rows" = Table.SelectRows(#"Changed Type", each [date] >= startp and [date] <= endt)
    in
        #"Filtered Rows"

     

    Best Regards,
    Zoe Zhi

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