Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
Hi,
Would like to check if it is possible to create new rows based on the value of existing rows? If yes, please advise how I can do this. Thank you!
Sample below:
Solved! Go to Solution.
Hello @lsihui_,
Can you please try this approach:
NewTable =
UNION (
'ExistingTable',
ADDCOLUMNS (
FILTER ( 'ExistingTable', 'ExistingTable'[Property] IN { "Apricot", "Blackcurrant" }),
"Property", IF ( 'ExistingTable'[Property] = "Apricot", "Combined A", "Combined B" ),
"Value",
VAR GroupA = CALCULATE( SUM('ExistingTable'[Value]), 'ExistingTable'[Group] = "A" )
VAR GroupB = CALCULATE( SUM('ExistingTable'[Value]), 'ExistingTable'[Group] = "B" )
RETURN
IF ( 'ExistingTable'[Property] = "Apricot", GroupA, GroupB ) - 'ExistingTable'[Value]
)
)
Your solution is so great Sahir_Maharaj
Hi, @lsihui_
In Power BI, we may not be able to insert rows on the go like Excel.
As provided by Super user, joining two tables together via the UNION function is how Power BI handles it.
If you want to customize the rows, you'll need to use a tool like Excel to insert them.
Best Regards
Jianpeng Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello @lsihui_,
Can you please try this approach:
NewTable =
UNION (
'ExistingTable',
ADDCOLUMNS (
FILTER ( 'ExistingTable', 'ExistingTable'[Property] IN { "Apricot", "Blackcurrant" }),
"Property", IF ( 'ExistingTable'[Property] = "Apricot", "Combined A", "Combined B" ),
"Value",
VAR GroupA = CALCULATE( SUM('ExistingTable'[Value]), 'ExistingTable'[Group] = "A" )
VAR GroupB = CALCULATE( SUM('ExistingTable'[Value]), 'ExistingTable'[Group] = "B" )
RETURN
IF ( 'ExistingTable'[Property] = "Apricot", GroupA, GroupB ) - 'ExistingTable'[Value]
)
)
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
83 | |
77 | |
40 | |
40 | |
35 |