Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi all
I have an address table with 3 x columns: ID, Seq#, Address.
I'm trying to concatenate the respective ADDRESS values (to make full address) based on order of SEQ numbers against each ID_NUMBER.
Note: I'm using DirectQuery, not Import.
Your Desired output can be possible but we have to do some modelling with the source data.
Please have a look into the model which is suitable for holding the Address Records
Steps:-
1. Go to the Edit Query
2. Select both SEQ and ADDRESS Column
3. Go to the Transform tab and select Pivot Column(in Advanced option choose Don't Aggregate).
4. Close and Apply
5. Right click on your Dataset and click New Column
6. Paste the DAX
ADDRESS = IF(SEARCH(",",SUBSTITUTE(
CONCATENATE('Address'[0],
CONCATENATE(",",
CONCATENATE('Address'[1],
CONCATENATE(",",
CONCATENATE('Address'[2],
CONCATENATE(",",
CONCATENATE('Address'[3],
CONCATENATE(",",
CONCATENATE('Address'[4],
CONCATENATE(",",
CONCATENATE('Address'[5],
CONCATENATE(",",
CONCATENATE('Address'[6],"")
)
)
)
)
)
)
)
)
)
)
)
),",,",","
)
)=1,REPLACE(SUBSTITUTE(
CONCATENATE('Address'[0],
CONCATENATE(",",
CONCATENATE('Address'[1],
CONCATENATE(",",
CONCATENATE('Address'[2],
CONCATENATE(",",
CONCATENATE('Address'[3],
CONCATENATE(",",
CONCATENATE('Address'[4],
CONCATENATE(",",
CONCATENATE('Address'[5],
CONCATENATE(",",
CONCATENATE('Address'[6],"")
)
)
)
)
)
)
)
)
)
)
)
),",,",","
)
,1,1," "
),SUBSTITUTE(
CONCATENATE('Address'[0],
CONCATENATE(",",
CONCATENATE('Address'[1],
CONCATENATE(",",
CONCATENATE('Address'[2],
CONCATENATE(",",
CONCATENATE('Address'[3],
CONCATENATE(",",
CONCATENATE('Address'[4],
CONCATENATE(",",
CONCATENATE('Address'[5],
CONCATENATE(",",
CONCATENATE('Address'[6],"")
)
)
)
)
)
)
)
)
)
)
)
),",,",","
)
)
Now please note in the Dax we are using SUBSTITUTE function to remove unwanted (comma)
and again using a REPLACE function to remove comma if encountered at first place
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
47 | |
22 | |
20 | |
15 | |
13 |
User | Count |
---|---|
49 | |
41 | |
39 | |
19 | |
19 |