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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Sakthikumar
Frequent Visitor

How to combine two Matrix table into Single Matrix table

Sakthikumar_0-1725626158148.pngSakthikumar_1-1725626173015.png

In the attached screenshot, I have two different Matrix table visuals. The first table has been created based on the measures listed below. All these measures have been added to the Values fields, with Date added to the columns.

in % = DIVIDE([Manu with>0.5% change],[Total_Count_MANU],0)
Total_Count_MANU =
    COUNTAX(
            SUMMARIZE(
                Base,
                'Base'[Date],
                Base[Category],
                Base[MANU],
                "Monthly%", [Monthly%]
            ),
           
        [Monthly%]
    )

Manu with>0.5% change =
   COALESCE( COUNTAX(
        FILTER(
            SUMMARIZE(
                Base,
                'Base'[Date],
                Base[Category],
                Base[MANU],
                "Monthly%", [Monthly%]
            ),
            OR(
                [Monthly%] > 0.005,
                [Monthly%] < -0.005
            )
        ),
        [Monthly%]
    ),
    0)

In the second screenshot, the matrix table is created based on the following measures. The Category and Manu are placed in the Rows field, Date is placed in the Columns field, and Monthly%_Manu_T is placed in the Values field.
Monthly%_Manu_T1 =
IF(
    HASONEVALUE('Hybrid Matrix'[Date]),
    SWITCH(
        TRUE(),
        VALUES('Hybrid Matrix'[Date]) = DATE(2900,01,01),
        CALCULATE(
            MAXX(
                ALL('Hybrid Matrix'[Date]),
                [Monthly%]
            ),
            REMOVEFILTERS('Hybrid Matrix'[Date])
        ),
        VALUES('Hybrid Matrix'[Date]) = DATE(1900,01,01),
        CALCULATE(
            MINX(
                ALL('Hybrid Matrix'[Date]),
                [Monthly%]
            ),
            REMOVEFILTERS('Hybrid Matrix'[Date])
        ),
        [Monthly%]
    ),

    BLANK()
)
Monthly% =
IF(
    OR
    ([Percent_of_Parent_Row_Total_SIM]<>BLANK(),
    [Percent_of_Parent_Row_Total_BAU]<>BLANK()
    )
    ,
    [Percent_of_Parent_Row_Total_BAU] - [Percent_of_Parent_Row_Total_SIM]
    ,
    0
)
 
Percent_of_Parent_Row_Total_BAU =
DIVIDE(
    [Sales_BAU],
    CALCULATE(
        [Sales_BAU],
        ALLSELECTED('Base'[MANU])
    ),
    0
)
 
Percent_of_Parent_Row_Total_SIM =
DIVIDE(
    [Sales_SIM],
    CALCULATE(
        [Sales_SIM],
        ALLSELECTED(Base[MANU])
    ),
    0
)
I am looking to combine these two table visuals into a single table visualization.
1 REPLY 1
Selva-Salimi
Super User
Super User

Hi @Sakthikumar ,

 

One simple solution is to add 3 rows in your category dimension named for example "A","B", "C" and then write a measure as follows:

if (selectedvalue (category)="A", [in %],if (selectedvalue (category)="B" , [total] , if (selectedvalue (category)="C" , [Manu with>0.5% change ] , Monthly%_Manu_T1)))

 

although it might not be the best solution but it works. to find out the best solution it need to know about your data model and....

 

If this post helps, then I would appreciate a thumbs up  and mark it as the solution to help the other members find it more quickly. 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.