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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Syndicate_Admin
Administrator
Administrator

Merge to find result

Good morning

I have a problem that I don't know how to fix.

I need to combine two columns to get me one percentage or another and compare it to a third to see if there are errors

One column is Category and another Section. I attach the table with the output percentage. What I want to know is how to do the operation to create another column with the percentage that corresponds to it and compare it with the existing one in case there are errors, since there are several conditionals.

I hope I have explained myself

Thanks a lot

StretchCategory 1Category 2Category 3
Up to 30.000 €90%50%30%
From 30.001 € to 60.000 €60%35%20%
from 60.001 € to 100.000 €30%20%10%

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

The first thing you want to do is get the data into a usable format by unpivoting it.

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCi1QKMlXMDbQMzAwUHjUtEZJR8nSQBVImoJJYyAZqxOt5FaUnwtRZQhSBdJjhqzHDKLaFEQaQfWkgfSYoegxNEDWZGwAU66jZAjSFAsA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Stretch = _t, #"Category 1" = _t, #"Category 2" = _t, #"Category 3" = _t]),
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(Source, {"Stretch"}, "Attribute", "Value")
in
    #"Unpivoted Other Columns"

 

Much better:

lbendlin_0-1629655358904.png

Now please explain the expected outcome based on this data.

View solution in original post

2 REPLIES 2
lbendlin
Super User
Super User

The first thing you want to do is get the data into a usable format by unpivoting it.

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCi1QKMlXMDbQMzAwUHjUtEZJR8nSQBVImoJJYyAZqxOt5FaUnwtRZQhSBdJjhqzHDKLaFEQaQfWkgfSYoegxNEDWZGwAU66jZAjSFAsA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Stretch = _t, #"Category 1" = _t, #"Category 2" = _t, #"Category 3" = _t]),
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(Source, {"Stretch"}, "Attribute", "Value")
in
    #"Unpivoted Other Columns"

 

Much better:

lbendlin_0-1629655358904.png

Now please explain the expected outcome based on this data.

Thank you very much for your help

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors