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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Sakthikumar
Regular 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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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