Forum Discussion

SianM's avatar
SianM
Frequent Visitor
8 years ago
Solved

Store measure output in new table

Hi,    I am generating a set of averages for a data set that I want to store and use as static inputs to different visualisations.    What is the best way for me to do this? Using calculated colu...
  • danextian's avatar
    danextian
    8 years ago

    Hi SianM

     

    Sorry. I was thinking that you were going to use a measure aggregate x measure (like sumx, countx, etc).  Summarize function actually accepts a measure as an argument.  So you could use

     

    Summarizetest =
    SUMMARIZE ( Raw1, Raw1[Milestone Status], "Average", [Dynamic Range] )

    Alternatively, you can use GROUPBY() and CURRENTGROUP() functions.  Example:

     

    Summarizetest =
    GROUPBY (
        Raw1,
        Raw1[Milestone Status],
        "Average", AVERAGEX ( CURRENTGROUP (), [Dynamic Range] )
    )

    More about these two functions at https://www.sqlbi.com/articles/nested-grouping-using-groupby-vs-summarize/