Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Create a measure that combines measures into same column

Hi everyone,

 

I need to create a measure that combines column values and measures into one table. I had to create custom measures to get a custom count value for INT0 from another table. 

 

Table 1

INTRANK MEASURECount Measure
INT0570

 

Table 2 

INT RANK ColumnCount Measure
INT120
INT240
INT330
INT40
INT510

 

Desired outcome appends both together with both measures combined in same columns

Table 3

INT RANKCOUNT
INT0570
INT120
INT2

40

INT3

30

INT4

0

INT5

10

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous ,

Try

Create a new Table

 

Union(
selectcolumns(Table1, Table1[INTRANK MEASURE],"Count Measure" , sum(Table1[Count Measure])),
selectcolumns(Table2, Table2[INTRANK MEASURE], "Count Measure", sum(Table2[Count Measure]))
)
OR
Union(
selectcolumns(Table1, "INTRANK MEASURE",Table1[INTRANK MEASURE],"Count Measure" ,Table1[Count Measure]),
selectcolumns(Table2,"INTRANK MEASURE" ,Table2[INTRANK MEASURE],"Count Measure" ,Table2[Count Measure])
)

 

 

OR a new dimension table and join with both the tables

 

Union(
all(Table1[INTRANK MEASURE]),
all(Table2[INTRANK MEASURE])
)

 

And create a new measure

Count = sum(Table1[Count Measure])+ sum(Table2[Count Measure])

 

 

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
v-yingjl
Community Support
Community Support

Hi @Anonymous ,

You can try this measure to create a new table:

Table 3 =
UNION (
    SELECTCOLUMNS (
        'Table',
        "INT RANK", 'Table'[INTRANK MEASURE],
        "COUNT", 'Table'[Count Measure]
    ),
    SELECTCOLUMNS (
        'Table 2',
        "INT RANK", 'Table 2'[INT RANK Column],
        "COUNT", 'Table 2'[Count Measure]
    )
)

 You will get the expected result:

combine columns.png

 

Best Regards,
Yingjie Li

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

amitchandak
Super User
Super User

@Anonymous ,

Try

Create a new Table

 

Union(
selectcolumns(Table1, Table1[INTRANK MEASURE],"Count Measure" , sum(Table1[Count Measure])),
selectcolumns(Table2, Table2[INTRANK MEASURE], "Count Measure", sum(Table2[Count Measure]))
)
OR
Union(
selectcolumns(Table1, "INTRANK MEASURE",Table1[INTRANK MEASURE],"Count Measure" ,Table1[Count Measure]),
selectcolumns(Table2,"INTRANK MEASURE" ,Table2[INTRANK MEASURE],"Count Measure" ,Table2[Count Measure])
)

 

 

OR a new dimension table and join with both the tables

 

Union(
all(Table1[INTRANK MEASURE]),
all(Table2[INTRANK MEASURE])
)

 

And create a new measure

Count = sum(Table1[Count Measure])+ sum(Table2[Count Measure])

 

 

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.