Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Union multiple sliced tables

Hi!

 

My requirement is as follows. I have multiple tables that have no direct relationships, but are all related to one table 'Type' 1:*. They need to be sliced independent of each other.  Those sliced tables then need to be unioned into one table.  Hopefully the below shows what I'm trying to do.  The data is all made up.

 

Table 1

Slicer value of 'Drink' applied

TypeOptionAmount
DrinkCoffee2
DrinkTea2
DrinkMilk3
DrinkOrang Juice4

 

Table 2

Slicer value of 'Bread' applied

TypeOptionAmount
BreadWhite5
BreadBrown4
BreadRye7
BreadSourdough4

 

Table 3

Slicer value of 'Cheese' applied

TypeOptionAmount
CheeseCheedar2
CheeseBlue3
CheeseBrie5
CheeseEdam6

 

Requirement

TypeOptionAmount
DrinkCoffee2
DrinkTea2
DrinkMilk3
DrinkOrang Juice4
BreadWhite5
BreadBrown4
BreadRye7
BreadSourdough4
CheeseCheedar2
CheeseBlue3
CheeseBrie5
CheeseEdam6
  • Hi Anonymous  , 

     

    It's not clear to me, I think you could append three tables and then use Slicer, or create new table to union them,  as follows:

    a)append three table and Select the three types.

    b)  Or create new table

    new table =
    VAR _drink =
        SUMMARIZE ( FILTER ( 'Table1', [Type] = "Drink" ), [Type], [Option], [Amount] )
    VAR _Bread =
        SUMMARIZE ( FILTER ( 'Table2', [Type] = "Bread" ), [Type], [Option], [Amount] )
    VAR _Cheese =
        SUMMARIZE ( FILTER ( 'Table3', [Type] = "Cheese" ), [Type], [Option], [Amount] )
    RETURN
        UNION ( _Bread, _Cheese, _drink )
    

    The final output is shown below:

     

    Best Regards,
    Community Support Team_ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.  

2 Replies

  • Anonymous , You can create a new table with slicer values.

    But with two Table Type , and Option.

    Join these two tables with table 1,2,3 and then in the visual use Type from Type and Option from Option

     

    And this measure

    measure = sum(Table1[Amount])  + sum(Table2[Amount]) + sum(Table3[Amount]) 

  • v-yalanwu-msft's avatar
    v-yalanwu-msft
    Community Support

    Hi Anonymous  , 

     

    It's not clear to me, I think you could append three tables and then use Slicer, or create new table to union them,  as follows:

    a)append three table and Select the three types.

    b)  Or create new table

    new table =
    VAR _drink =
        SUMMARIZE ( FILTER ( 'Table1', [Type] = "Drink" ), [Type], [Option], [Amount] )
    VAR _Bread =
        SUMMARIZE ( FILTER ( 'Table2', [Type] = "Bread" ), [Type], [Option], [Amount] )
    VAR _Cheese =
        SUMMARIZE ( FILTER ( 'Table3', [Type] = "Cheese" ), [Type], [Option], [Amount] )
    RETURN
        UNION ( _Bread, _Cheese, _drink )
    

    The final output is shown below:

     

    Best Regards,
    Community Support Team_ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.