Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

New table based on a query

Hi,

I'm new to PowerBI Web and would like to create a new table based on the result of a query.

This is what I have:

let
  Source = INTAKT_VIEW,
  #"Grouped rows" = Table.Group(Source, {"Period"}, {{"Sum"each List.Sum([Intakt]), type nullable number}})
in
  #"Grouped rows"
 
How can I create a new table with two columns Period sumIntakt?
  • Hi Anonymous ,

     

    You can try this method:

    Use the Group By:

    The result is:

     

    Or you can download the Power BI Desktop:

    Get Power BI Desktop - Power BI | Microsoft Learn

    Hope this helps you.

     

    Best Regards,

    Community Support Team _Yinliw

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

     

     

8 Replies

  • Hi! Anonymous 

     

    The problem is not clear. Can you please share sample data and expected result?

     

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Two tables. How can I save the aggregated table?

    Original table

    Period 

    SumIntakt

     

    120
    120
    230

     

    Aggregated table

    PeriodSumIntakt
    140
    230
    • v-yinliw-msft's avatar
      v-yinliw-msft
      Icon for Community Support rankCommunity Support

      Hi Anonymous , 

       

      There are three methods to solve this question:

       

      Method 1:

      New a measure:

      Sumlntakt1 = CALCULATE(SUM('Table'[SumIntakt]),ALLEXCEPT('Table','Table'[Period]))

       

      Method 2:

      Method 3:

      New a table:

      TableS = SUMMARIZE('Table','Table'[Period], "Sumlntakt", SUM('Table'[SumIntakt]))

       

      Hope this help you.

      Here is my PBIX file:

       

      Best Regards,

      Community Support Team _Yinliw

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

      • Anonymous's avatar
        Anonymous
        Not applicable

        I got this:

        Expression.Error: Token Literal expected.
        Details
        TableS = SUMMARIZE('INTAKT_VIEW','INTAKT_VIEW'[Period], "Sumlntakt", SUM('INTAKT_VIEW'[SumIntakt]))
    • NikhilChenna's avatar
      NikhilChenna
      Icon for Skilled Sharer rankSkilled Sharer

      Hi Anonymous , The best solution is the below.

      By creating a measure.

       Measure = CALCULATE(SUM('Table'[SumIntakt]),ALLEXCEPT('Table','Table'[Period]))

       

       

      Regards,

      Nikhil Chenna

       

      Appreciate with a Kudos!! (Click the Thumbs Up Button)
      Did I answer your question? Mark my post as a solution!