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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
nbufff
Helper I
Helper I

How to duplicate value in matrix visual

Dear Community, I was asked to duplicate some value from one group to other group, it is easy in excel but seemed stuck if that could be used by certain Measure in PBI.

My Case:  I used below data to generate the matrix table.

MAV DateLine_NameVSQty
12/19/2024GroupATeam95
12/18/2024GroupATeam94
12/19/2024GroupBTeam93
12/18/2024GroupBTeam92
12/19/2024AC01Team 51

 

I need to put the Group B data under Team 9 to Team 5 as yellow high-lighted below. 

nbufff_0-1734504582659.png

My solution is to filter Group B data from above table and rename VS toTeam 5, save as new table,  then use union to join this new table with original table. It works but is there any easy way e.g. set up certain measure to fulfill that?

Thanks for help!

1 ACCEPTED SOLUTION

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]

)

vhashadapu_1-1734597259192.png

  1. 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

)

vhashadapu_2-1734597291226.png

3. Create a Measure for Total Quantity:

Total Qty = SUM('CombinedTable'[Qty])

4. Build a Matrix Visual

vhashadapu_3-1734597372116.png

5. output will look like this:

vhashadapu_4-1734597418881.png

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.



 

View solution in original post

8 REPLIES 8
v-hashadapu
Community Support
Community Support

Hi @nbufff ,Thank you for reaching out to Microsoft Fabric Community Forum.

Try this:

Create a Calculated Column:

Adjusted VS =

IF (

    'Table'[Line_Name] = "GroupB" && 'Table'[VS] = "Team9",

    "Team 5",

    'Table'[VS]

)

Create a Measure for Total Quantity:

Total Qty = SUM('Table'[Qty])

Build Your Matrix Table:

 

Go to the Report view by clicking the Report icon on the left pane.

Insert a Matrix Visual from the Visualizations pane.

In the Fields pane, drag Adjusted VS to the Rows section.

Drag MAV Date (or any other appropriate column) to the Columns section.

Drag the Total Qty measure to the Values section.

 

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.

@v-hashadapu ,thanks for your advise. If I create the calculated column, the qty on group B will be moved to Team 5 but it will not be available under Team 9. Can we make it showing both on Team 5 and Team 9?

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]

)

vhashadapu_1-1734597259192.png

  1. 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

)

vhashadapu_2-1734597291226.png

3. Create a Measure for Total Quantity:

Total Qty = SUM('CombinedTable'[Qty])

4. Build a Matrix Visual

vhashadapu_3-1734597372116.png

5. output will look like this:

vhashadapu_4-1734597418881.png

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.



 

Thanks for your update. If there's no other way around, I accepted that as the solution.

@v-hashadapu ,thanks for advice. That's also my way in dealing with this. I posted question here also want to learn if there's any other better  solution without creating additional two tables.

Hi @nbufff ,Thank you for reaching out to Microsoft Fabric Community Forum.

Unfortunately, there is no other workaround without creating at least one additional table. Please try this

Create a New Calculated Table:

DuplicatedTable =

UNION (

    SELECTCOLUMNS(

        'SalesData',

        "MAV Date", 'SalesData'[MAV Date],

        "Line_Name", 'SalesData'[Line_Name],

        "VS", 'SalesData'[VS],

        "Qty", 'SalesData'[Qty]

    ),

    SELECTCOLUMNS(

        FILTER('SalesData', 'SalesData'[Line_Name] = "GroupB" && 'SalesData'[VS] = "Team9"),

        "MAV Date", 'SalesData'[MAV Date],

        "Line_Name", 'SalesData'[Line_Name],

        "VS", "Team 5",

        "Qty", 'SalesData'[Qty]

    )

)

vhashadapu_0-1734693945570.png

 

Create a measure:

Total Qty = SUM('DuplicatedTable'[Qty])

Create a Matrix Visual:

vhashadapu_1-1734693983985.png

 

Output from Matrix:

vhashadapu_2-1734694011298.png

If this helps, please mark it ‘Accept as Solution’, so others with similar queries may find it more easily.



dharmendars007
Memorable Member
Memorable Member

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

LinkedIN 

@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)

 

nbufff_0-1734572681159.png

 

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.