Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

DAX - Create New Table with variable table

I would like to create a sumarize table through a temporary table using only one dax formula.

Example:
Table - Trimestre

DataInicioDataFim
201911202001
201912202002


Table - Sales
PeriodSales

PeriodSales
201910100
201910200
201910300
201911400
201911450
201912460
201912100
202001250
202001260


Summarize Table

 

 

I would like to use the table created in the variable "vFilterTable" to calculate de average of [Total] columns by [DataFim] columns directly in this same dax formula. My ideia it was use de function summarizecolumns like below, but it´s not permited. Is there any way to have this summarize result without create another table?



The result that I spect is that:

  • Can you please try using after VAR vfiltertable

     

    VAR _x = groupby(vfiltertable,[datafim],"Average", AVERAGEX(CURRENTGROUP(),[total])

    RETURN

    VAR _x

     

3 Replies

  • smpa01's avatar
    smpa01
    Community Champion

    Can you please try using after VAR vfiltertable

     

    VAR _x = groupby(vfiltertable,[datafim],"Average", AVERAGEX(CURRENTGROUP(),[total])

    RETURN

    VAR _x

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      It´s works perfectly.
      I didn´t espected that would be so easy. I liked it

      Thanks.