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
jmfillman
Helper I
Helper I

Matrix Challenges

The Matrix visual is something I am really struggling to understand in relation to my data, and after days of trying, I cannot get what I need. I have a Pro, not Enterprise account.

 

I have 4 tables (also see the first image):

1) Project Table

2) Plan Table (Many to One to Project Table)

3) Requested (Many to One to Plan Table)

4) Approved (Many to One to Plan Table)

 

Demonstrated in Excel, tables are in BI Dataflow with a Dataset and Report.

jmfillman_0-1688428930880.png

 

I am trying to achieve something like the below image and a Matrix seems the appropriate visual. I have been able to get something close (although still not quite), if I only use the Requested Plan table OR the Approved Plan table, but not together.

 

jmfillman_1-1688429168592.png

 

Been trying things for days and just not making progress. Any solutions or similar examples you might point me to would be appreciated.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @jmfillman ,

 

Here I suggest you to create three dim tables to help you calculating.

My Test:

vrzhoumsft_0-1688536949271.png

DimGroup = FILTER(DISTINCT(UNION(VALUES('Approved Plan'[Group]),VALUES('Requested Plan'[Group]))),[Group]<>BLANK())
DimQuarter = FILTER(DISTINCT(UNION(VALUES('Approved Plan'[Fiscal Quarter]),VALUES('Requested Plan'[Fiscal Quarter]))),[Fiscal Quarter]<>BLANK())
DimYear = FILTER(DISTINCT(UNION(VALUES('Approved Plan'[Fiscal Year]),VALUES('Requested Plan'[Fiscal Year]))),[Fiscal Year]<>BLANK())

Measures:

Approved = 
CALCULATE (
    SUM ( 'Approved Plan'[Approved Hour] ),
    FILTER (
        'Approved Plan',
        'Approved Plan'[State] = "Approved"
            && 'Approved Plan'[Group] = MAX ( DimGroup[Group] )
            && 'Approved Plan'[Fiscal Year] = MAX ( DimYear[Fiscal Year] )
            && 'Approved Plan'[Fiscal Quarter] = MAX ( DimQuarter[Fiscal Quarter] )
    )
)
Planned = 
CALCULATE (
    SUM ( 'Requested Plan'[Planned Hour] ),
    FILTER (
        'Requested Plan',
        'Requested Plan'[State] = "Planned"
            && 'Requested Plan'[Group] = MAX ( DimGroup[Group] )
            && 'Requested Plan'[Fiscal Year] = MAX ( DimYear[Fiscal Year] )
            && 'Requested Plan'[Fiscal Quarter] = MAX ( DimQuarter[Fiscal Quarter] )
    )
)
Requested = 
CALCULATE (
    SUM ( 'Requested Plan'[Planned Hour] ),
    FILTER (
        'Requested Plan',
        'Requested Plan'[State] = "Requested"
            && 'Requested Plan'[Group] = MAX ( DimGroup[Group] )
            && 'Requested Plan'[Fiscal Year] = MAX ( DimYear[Fiscal Year] )
            && 'Requested Plan'[Fiscal Quarter] = MAX ( DimQuarter[Fiscal Quarter] )
    )
)

Result is as below.

vrzhoumsft_1-1688537050067.png

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @jmfillman ,

 

Here I suggest you to create three dim tables to help you calculating.

My Test:

vrzhoumsft_0-1688536949271.png

DimGroup = FILTER(DISTINCT(UNION(VALUES('Approved Plan'[Group]),VALUES('Requested Plan'[Group]))),[Group]<>BLANK())
DimQuarter = FILTER(DISTINCT(UNION(VALUES('Approved Plan'[Fiscal Quarter]),VALUES('Requested Plan'[Fiscal Quarter]))),[Fiscal Quarter]<>BLANK())
DimYear = FILTER(DISTINCT(UNION(VALUES('Approved Plan'[Fiscal Year]),VALUES('Requested Plan'[Fiscal Year]))),[Fiscal Year]<>BLANK())

Measures:

Approved = 
CALCULATE (
    SUM ( 'Approved Plan'[Approved Hour] ),
    FILTER (
        'Approved Plan',
        'Approved Plan'[State] = "Approved"
            && 'Approved Plan'[Group] = MAX ( DimGroup[Group] )
            && 'Approved Plan'[Fiscal Year] = MAX ( DimYear[Fiscal Year] )
            && 'Approved Plan'[Fiscal Quarter] = MAX ( DimQuarter[Fiscal Quarter] )
    )
)
Planned = 
CALCULATE (
    SUM ( 'Requested Plan'[Planned Hour] ),
    FILTER (
        'Requested Plan',
        'Requested Plan'[State] = "Planned"
            && 'Requested Plan'[Group] = MAX ( DimGroup[Group] )
            && 'Requested Plan'[Fiscal Year] = MAX ( DimYear[Fiscal Year] )
            && 'Requested Plan'[Fiscal Quarter] = MAX ( DimQuarter[Fiscal Quarter] )
    )
)
Requested = 
CALCULATE (
    SUM ( 'Requested Plan'[Planned Hour] ),
    FILTER (
        'Requested Plan',
        'Requested Plan'[State] = "Requested"
            && 'Requested Plan'[Group] = MAX ( DimGroup[Group] )
            && 'Requested Plan'[Fiscal Year] = MAX ( DimYear[Fiscal Year] )
            && 'Requested Plan'[Fiscal Quarter] = MAX ( DimQuarter[Fiscal Quarter] )
    )
)

Result is as below.

vrzhoumsft_1-1688537050067.png

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

In your test file, this works pretty much as expected, but integration this into my existing report, I keep hitting a wall. All the dimension tables are showing the merged data, but even though my table relationships match, but as soon as I add any of the Dimension columns into the Matrx, it cannot find the relationship between fields, presumably up to the Project Table as that is the table for the first 2 Rows fields. Adding the 3rd row(any dimension table column), doesn't work.

 

I can't share the PBIX as it has internal data and connected internally and wouldn't connect anyway...

Wow, thank you! Going to have to play with this for a while, but certainly looks to be what I need or enough to ultimately get to what I need.

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.