Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

PowerQuery M instead of DAX

Hello I have some probleme with memory "The memory used by the query exceeded the configured limit.". I think the problem is a table of 5 M rows generate in DAX. Could someone help me to transform...
  • HotChilli's avatar
    5 years ago

    Looks like you want a table from

     

    Bob    12 May 2020    14 May 2020

     

    ->

    Bob 12 May 2020

    Bob 13 May 2020

    Bob 14 May 2020

     

    If so, in Power Query, add a column like this

    {Number.From([DateStart])..Number.From([DateEnd])}

     

    This will make a list on each row.  You can then Expand the list from the column header.  Then change the datatype to Date

  • v-alq-msft's avatar
    5 years ago

    Hi, Anonymous 

     

    Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.

    Table:

     

    You may add a custom column with the following codes.

    let diff = Duration.Days([Date_End]-[Date_Start])+1 in 
    List.Dates(
       [Date_Start],diff,#duration(1,0,0,0)
    )

     

     

    Then you need to expand 'Custom' to new rows to get the result.

     

    Result:

     

    Best Regards

    Allan

     

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