Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Automatically store measures in a table after a refresh on a daily basis.

Hi,   I have what I hope is a simple request and I'm looking for a solution you may be able to help with.   I have a Power BI report that has a data source (production support ticket source) and ...
  • sevenhills's avatar
    sevenhills
    3 years ago

    If you can provide examples with some sample data , it will help us to answer. Any aggregations to present persistently, I prefer doing in power query.

     

    Since you want to do DAX, it is definitely possible. Try looking into these and see if that helps. Summarize, UNION, SELECTCOLUMNS...

     

    DATATABLE: try checking this article

    https://www.sqlbi.com/articles/create-static-tables-in-dax-using-the-datatable-function/

     

    Random example to help you understand and say it can be done.

    I am creating a table using UNION of two tables. Each table has to be same number of columns and data types. 

    Table = 
    UNION (
        CALCULATETABLE(
            SUMMARIZE (
                Sales,
                'Product'[Category],
                'Date'[YYYY-MM],
                "Measure", "Count",
                "Count", 'Sales Order'[Orders count]
            )
            , Year('Date'[Date]) = 2020
        )
        ,
        CALCULATETABLE(
            SUMMARIZE (
                Sales,
                'Product'[Category],
                'Date'[YYYY-MM],
                "Measure", "Sales",
                "Sales", [Total Sales]
            )
            , Year('Date'[Date]) = 2020
        )
    )

    Data view tab:

     

    I hope this gives some direction. If this is not what you need, Sorry, please could you provide more info.