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
Venson
Frequent Visitor

Mapping data based on the column header and content

Hi everyone,

Thanks for your times here.

I got one request is to review vendor's response and auto mapping the result.

Tried some method but fail,

Below is my raw data. hope can have your kindly support here. many thanks 🙂

 

1. In the database, we have all vendor information, specification and key attribute as below

SpecAttribute1Attribute2Attribute3Attribute4vendorproduct
SpecAYesNoACaa1
SpecAYesNoACaa2
SpecBYesYesACaa3
SpecCYesYesBDbb1
SpecDNoYesBDbb2

 

2. next step, our manger define a checklist questions base on different kind of attribute as below.

ChecklistAttribute requirement
Question1Attribute1(yes) and Attribute2(yes)
Question2Attribute1(yes) and Attribute3(A)
Question3All
Question4Attribute1(yes) or Attribute3(B)

 

3. next step, we collect "vendor a" and "vendor b" response which product they checked, two tables as below

ChecklistAttribute requirementProduct
Question1Attribute1(yes) and Attribute2(yes)a1 ; a2
Question2Attribute1(yes) and Attribute3(A)a1
Question3Alla1
Question4Attribute1(yes) or Attribute3(B)a1

 

ChecklistAttribute requirementProduct
Question1Attribute1(yes) and Attribute2(yes)b1
Question2Attribute1(yes) and Attribute3(A)b1
Question3Allb1 ; b2
Question4Attribute1(yes) or Attribute3(B)b3

 

Final mapping result I'd like to show on dashabord.

ChecklistAttribute requirementProductMapping successMapping missMapping wrongMapping success countMapping miss countMapping wrong count
Question1Attribute1(yes) and Attribute2(yes)a1 ; a2 ; b1b1a3a1 ; a2112
Question2Attribute1(yes) and Attribute3(A)a1 ; b1a1a2 ; a3b1121
Question3Alla1 ; b1 ; b2a1 ; b1 ; b2a2 ; a3N/A320
Question4Attribute1(yes) or Attribute4(C)a1 ; b3a1a2 ; a3 ; b1b3131
4 REPLIES 4
Daniel29195
Super User
Super User

@Venson hello, 

 

kindly find attached thee file . 

https://drive.google.com/file/d/1PBjdX9cFc2hCL_gMg6dCzGUdZ8Jk7NFA/view?usp=sharing

 

Daniel29195_0-1705838132643.png

if this is what you want, you need some transformations on your data to be able to get the output you want .

i didnt create all the required measures, cz the measures will be same as the second one, just you need to change the conditions in the switch statement in the code .

Daniel29195_1-1705838221607.png

 



hope this makes sense to you .

 

 

 

 

best regards. 

Hi Sir, many thanks 🙂 !!

as you mentioned, might need some transform from row data to achieve the table 4 as yours, I can combine two vendor's reponse trough feature "apped", but don't know how to make it become seperated row, for example, vendor a put product a1 ; a2 for Quesiton1, and I tried some pivot or tranpose still can't make it become two row, may please help me ?

@Venson 

i will help you out dont worry 

to expand the a1 ; b1 to multiple rows,  follow the following steps : 

 

step1 :  go to poewr query

step2 :  select the table in question

step3 :  select the column in question 

step 4 ; go to transform 

step 5 :  under transform choose --_>  split colums --> by delimiter 

Daniel29195_0-1705867001861.png

 

step 6 : configure as below : 

Daniel29195_1-1705867064493.png

 

 

done 

this will expand the row into multiple rows. 

 

 

 

if this helps you, dont forget to hit that thumbs up 👍 button . 

 

let me know if you have any further questions  . 

Hi Sir, really appreciate your support !!

I got one problem that I wanna got measure column with the "correct answer column" and "need vendor to check column"

 

1. correct answer column is to show the correct answer after compare table 2 & 4

2. need vendor to check column is to point out which product vendor miss out to comfirm

 

I tried to modify the measure but still can not get it, may please help me ?

Venson_0-1705918953763.png

Measure_Mapping Correct Answer =
VAR datasource1 =
ADDCOLUMNS(
    SUMMARIZE(
        'Table (2)',
        'Table (2)'[Product],
        'Table (2)'[attribute1],
        'Table (2)'[Attribute2],
        'Table (2)'[Attribute3],
        'Table (2)'[Attribute4]
       ),
    "check",
    SWITCH(
        TRUE(),
        SELECTEDVALUE('Table (4)'[Checklist]) = "Quesiton1" && ('Table (2)'[attribute1] = "Yes" && 'Table (2)'[Attribute2] = "Yes") , 1,

        SELECTEDVALUE('Table (4)'[Checklist]) = "Quesiton2" && ('Table (2)'[attribute1] = "Yes" && 'Table (2)'[Attribute3] = "A") , 1,

        SELECTEDVALUE('Table (4)'[Checklist]) = "Question3", 1,
       
        SELECTEDVALUE('Table (4)'[Checklist]) = "Quesiton4" && ('Table (2)'[attribute1] = "Yes" || 'Table (2)'[Attribute3] = "B") , 1,
        0
    )
)

VAR filter_datesource1 =
FILTER(
    datasource1,
    [check] = 1
)

return  
CONCATENATEX(
    filter_datesource1,
    'Table (2)'[Product],
    " ; "
)

 

 

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.