Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon'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.
Dear All, i need your help to understand...
I have to tables (simple tables):
TAB A
NOME | CITTA |
CARLOTTA | PISA |
FEDERICA | FIRENZE |
MIMMO | NAPOLI |
PIERO | NAPOLI |
MARCO | MILANO |
TAB B
NOME | SCUOLA |
IDA | DINI |
CARLOTTA | FIBONACCI |
SALVATORE | FERMI |
FEDERICA | FERMI |
MIMMO | DINI |
GIOVANNI | BUONARROTI |
I would like to realize a table like this:
NOME | CITTA | SCUOLA |
CARLOTTA | PISA | FIBONACCI |
FEDERICA | FIRENZE | FERMI |
MIMMO | NAPOLI | DINI |
PIERO | NAPOLI | |
MARCO | MILANO | |
IDA | DINI | |
SALVATORE | FERMI | |
GIOVANNI | BUONARROTI |
Is it possible? How?
Thank you very much for your help.
Solved! Go to Solution.
Hey,
If you have access to Power Query, you can use Merge Queries, and use Full Outer Type.
The result should be something like the above. To get the NOME column to look like your result, you can use a query like: Table.AddColumn(#"Expanded Tab B", "NOME (Keep)", each if [NOME] = null then [NOME.1] else [NOME]) in PowerQuery to a column without null in the NOME column.
If you want to do so in DAX, try something like:
MergedTable = ADDCOLUMNS(
DISTINCT(
UNION(SELECTCOLUMNS('Tab A', "NOME", 'Tab A'[NOME]), SELECTCOLUMNS('Tab B', "NOME",('Tab B'[NOME])))
),
"Citta", CALCULATE(MAX('Tab A'[CITTA]), 'Tab A'[NOME] = EARLIER([NOME])),
"Scuola", CALCULATE(MAX('Tab B'[SCUOLA]), 'Tab B'[NOME] = EARLIER([NOME]))
)
Hey,
If you have access to Power Query, you can use Merge Queries, and use Full Outer Type.
The result should be something like the above. To get the NOME column to look like your result, you can use a query like: Table.AddColumn(#"Expanded Tab B", "NOME (Keep)", each if [NOME] = null then [NOME.1] else [NOME]) in PowerQuery to a column without null in the NOME column.
If you want to do so in DAX, try something like:
MergedTable = ADDCOLUMNS(
DISTINCT(
UNION(SELECTCOLUMNS('Tab A', "NOME", 'Tab A'[NOME]), SELECTCOLUMNS('Tab B', "NOME",('Tab B'[NOME])))
),
"Citta", CALCULATE(MAX('Tab A'[CITTA]), 'Tab A'[NOME] = EARLIER([NOME])),
"Scuola", CALCULATE(MAX('Tab B'[SCUOLA]), 'Tab B'[NOME] = EARLIER([NOME]))
)
Thank you very much for your wonderful help!
Thank you very much for your reply but i need to show all names in the first column. That could be possible managing relationship in power bi?
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
97 | |
65 | |
45 | |
39 | |
31 |
User | Count |
---|---|
164 | |
111 | |
61 | |
53 | |
38 |