Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
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 MEASURE | Count Measure |
| INT0 | 570 |
Table 2
| INT RANK Column | Count Measure |
| INT1 | 20 |
| INT2 | 40 |
| INT3 | 30 |
| INT4 | 0 |
| INT5 | 10 |
Desired outcome appends both together with both measures combined in same columns
Table 3
| INT RANK | COUNT |
| INT0 | 570 |
| INT1 | 20 |
| INT2 | 40 |
| INT3 | 30 |
| INT4 | 0 |
| INT5 | 10 |
Solved! Go to Solution.
@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])
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:
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.
@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])
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 44 | |
| 43 | |
| 38 | |
| 18 | |
| 16 |
| User | Count |
|---|---|
| 67 | |
| 63 | |
| 30 | |
| 30 | |
| 23 |