Belgian Power BI User Group

Please login or click SIGN UP FOR FREE to create your PowerBIUG account to join this user group.
Expand all | Collapse all

Power Query: How to add a calculated row?

Jump to Best Answer
  • 1.  Power Query: How to add a calculated row?

    Posted Feb 17, 2020 08:47 AM
    Edited by Koen Decolvenaer Feb 21, 2020 09:39 AM
    Hello fellow PowerBI people

    I would like to add a calculated row in my dataset.

    Database contains + 100 000 rows. There's a different row for each quarter. And I would like to add a new line that gives me the best result over the 4 quarters.

    I know I can group this column and add a calculated column, but that is no solution for me as I'll have trouble afterwards filtering correctly.

    Example:

    Year Extra info A Extra info B Quarter Amount
    2019 Abc Zyx 1 80
    2019 Abc Zyx 2 null
    2019 Abc Zyx 3 50
    2019 Abc Zyx 4 60
    2019 Abc Zyx Best result 80

    Thanks in advance for your help!

    I think this function can help me: https://docs.microsoft.com/en-us/powerquery-m/table-insertrows

    Best regards

    Koen


    ------------------------------
    Koen Decolvenaer
    Vives
    Kortrijk
    ------------------------------


  • 2.  RE: Power Query: How to add a calculated row?
    Best Answer

    Top Contributor
    Posted Feb 18, 2020 04:11 AM
      |   view attached
    Je vous invite à consulter la solution en pièce jointe.
    Le principe est simple
    1. Faire référence à la source
    2. Faire un regroupement de la référence
    3. Ajouter le résultat à la source


    ------------------------------
    Regards
    Mehdi HAMMADI
    CoGitar / 23389830
    mehdi.hammadi@cogitar.com
    ------------------------------

    Attachment(s)



  • 3.  RE: Power Query: How to add a calculated row?

    Posted Feb 21, 2020 09:40 AM

    Thanks! This worked as a charm.

    It's only very slow (big dataset)

    Best regards

    Koen



    ------------------------------
    Koen Decolvenaer
    Vive
    Kortrijk
    ------------------------------