Forum Discussion

Birinder's avatar
Birinder
Helper III
4 years ago
Solved

How to create a dummy table ?

Hi there,
My query is very simple.

Suppose, We have 3 different data tables, which are related to each other.
Now I want to show each column from a different data source in a new dummy table.
Like, 3 column table, in which, each column is extracted from a different data table.

TABLE 1

IDProduct
1Household
2Outdoor

 

TABLE 2

DateProduct
1-1-2021Household
2-12-2021Outdoor

 

TABLE 3

DatePrice
1-1-20211000
2-12-20212000


MY DESIRED TABLE

DateProductPrice 
1-1-2021Household1000 
2-12-2021Outdoor2000


Please note that I want to use this as a code, when creating a new table in data model.
Thanks in Advance.

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Birinder ,

     

    Based on my test, we could not use DAX to create calculated column and calculated table when using Live connetion mode:

     

    If the original relationship is as below:

    You could directly drag fields to Table visual:

     

     

    Or please create a measure instead:

     

    Measure = CALCULATE(SUM('TABLE 3'[Price]),FILTER('TABLE 3',[Date]=MAX('TABLE 2'[Date])))

     

     

     

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

7 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Birinder ,

     

    Based on my test, we could not use DAX to create calculated column and calculated table when using Live connetion mode:

     

    If the original relationship is as below:

    You could directly drag fields to Table visual:

     

     

    Or please create a measure instead:

     

    Measure = CALCULATE(SUM('TABLE 3'[Price]),FILTER('TABLE 3',[Date]=MAX('TABLE 2'[Date])))

     

     

     

    Best Regards,
    Eyelyn Qin
    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

    Hi Birinder , this is my method to achieve the result table:

     

    ADDCOLUMNS(Table01, "Date", LOOKUPVALUE(Table02[Date], Table02[Products], Table01[Product]))

     

    This will achieve a table as below:

     

    After that use "New Column" to add in te Price.

     

    CALCULATE(SUM(Table03[Price]), FILTER(Table03, Table03[Date] = 'Union'[Date]))

     

    Thank you.