Forum Discussion
How to duplicate value in matrix visual
- 1 year ago
Hi ,Thank you for reaching out to Microsoft Fabric Community Forum.
We can do that by creating a new table that duplicates the rows for GroupB under both Team9 and Team 5 and then combining this table with the original one using DAX.
1. Create a Duplicate Table:DuplicatedTable =
SELECTCOLUMNS (
FILTER (
'Table',
'Table'[Line_Name] = "GroupB" && 'Table'[VS] = "Team9"
),
"MAV Date", 'Table'[MAV Date],
"Line_Name", 'Table'[Line_Name],
"VS", "Team 5",
"Qty", 'Table'[Qty]
)
- Create a Combined Table:
CombinedTable =
UNION (
SELECTCOLUMNS (
'Table',
"MAV Date", 'Table'[MAV Date],
"Line_Name", 'Table'[Line_Name],
"VS", 'Table'[VS],
"Qty", 'Table'[Qty]
),
DuplicatedTable
)
3. Create a Measure for Total Quantity:
Total Qty = SUM('CombinedTable'[Qty])
4. Build a Matrix Visual
5. output will look like this:
If this helps, please mark it ‘Accept as Solution’, so others with similar queries may find it more easily. If not, please share the details.
Hello nbufff ,
You can use a measure to sum quantities as if Group B under Team 9 appears under Team 5.
Sum of Qty Adjusted =
VAR GroupBQty =
CALCULATE (
SUM ( 'OriginalTable'[Qty] ),
'OriginalTable'[Line_Name] = "GroupB",
'OriginalTable'[Line_NameVS] = "Team9")
RETURN
CALCULATE (
SUM ( 'OriginalTable'[Qty] )) +
IF (
SELECTEDVALUE ( 'OriginalTable'[Line_NameVS] ) = "Team5" &&
SELECTEDVALUE ( 'OriginalTable'[Line_Name] ) = "GroupB",
GroupBQty,0)
If you find this helpful , please mark it as solution which will be helpful for others and Your Kudos/Likes 👍 are much appreciated!
Thank You
Dharmendar S
dharmendars007 Thanks for your advise. I applied your code below it seemed still same as before, could you pls check if I missed something?
Sum of Qty Adjusted =
VAR GroupBQty =
CALCULATE (
SUM ( 'Data'[Qty] ),
'Data'[Line_Name] = "GroupB",
'Data'[VS] = "Team9")
RETURN
CALCULATE (
SUM ( 'Data'[Qty] )) +
IF (
SELECTEDVALUE ( 'Data'[VS] ) = "Team5" &&
SELECTEDVALUE ( 'Data'[Line_Name] ) = "GroupB",
GroupBQty,0)