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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
eduardofavilla
Frequent Visitor

Help to split a row into two based on condition on Power Query

Hi team! I am struggling to split a row into two based on condition on Power Query.

I have the table below where there is a column called CL4. Every time this column has the word "Flemingo", the value on Amount column should be split in two rows, one with 22% of the original value and other with 73%.

Does anyone can give me a help to achieve this solution?

Below the original table:

 Cust Hier Level 4  Forecast Group  Date  Net net proceeds of sales [3060] 

L4 28 Kaimay Trading28 INFANT FORMULA17-Jan-22                                                                79,522.73
L4 28 Flemingo28 NESCAFE30-Jan-23                                                             133,834.46

 

And the desired table:

 Cust Hier Level 4  Forecast Group  Date  Net net proceeds of sales [3060] 

L4 28 Kaimay Trading28 INFANT FORMULA17-Jan-22                                                         79,522.73
L4 28 Flemingo28 NESCAFE30-Jan-23                                                         30,476.71
L4 28 Flemingo28 NESCAFE30-Jan-23                                                      103,357.75
1 REPLY 1
rajendraongole1
Super User
Super User

Hi @eduardofavilla - Create a calculated table which contain the split rows and can be used in your visuals and reports

 

SplittedSalesTable =
VAR SplitFlemingo =
ADDCOLUMNS (
FILTER ( Sales, CONTAINSSTRING ( Sales[Cust Hier Level 4], "Flemingo" ) ),
"SplitAmount1", Sales[Net net proceeds of sales [3060]] * 0.22,
"SplitAmount2", Sales[Net net proceeds of sales [3060]] * 0.78
)
VAR UnsplitTable =
FILTER ( Sales, NOT CONTAINSSTRING ( Sales[Cust Hier Level 4], "Flemingo" ) )
VAR ResultTable =
UNION (
SELECTCOLUMNS (
SplitFlemingo,
"Cust Hier Level 4", [Cust Hier Level 4],
"Forecast Group", [Forecast Group],
"Date", [Date],
"Net net proceeds of sales [3060]", [SplitAmount1]
),
SELECTCOLUMNS (
SplitFlemingo,
"Cust Hier Level 4", [Cust Hier Level 4],
"Forecast Group", [Forecast Group],
"Date", [Date],
"Net net proceeds of sales [3060]", [SplitAmount2]
),
SELECTCOLUMNS (
UnsplitTable,
"Cust Hier Level 4", [Cust Hier Level 4],
"Forecast Group", [Forecast Group],
"Date", [Date],
"Net net proceeds of sales [3060]", [Net net proceeds of sales [3060]]
)
)
RETURN
ResultTable

 

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.