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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Help with Matrix

I want to add a matrix to my report. I need it to look like the image below.

Vacation Dashboard example.png

 

I have 4 tables:

  • Employee info table
  • Employee Vacation Days balance table
  • Vacation type table (has two values: "Planned Vacation" and "Actual Days Taken")
  • Planned Vacation table whose columns are the employee ID, each individual month (JAN, FEB, MAR, etc...), and Year (2020 for now) and each row has distinct employee, the number of days they are planning to takeoff of the corresponding month column.
  • Actual Days Taken table whose columns are the employee ID, each individual month (JAN, FEB, MAR, etc...), and Year (2020 for now) and each row has distinct employee, the number of days they are actually taking off of the corresponding month column.

How do I arrange the data in the Rows, Columns, and Values fields to get the result in the image?

3 REPLIES 3
PaulDBrown
Community Champion
Community Champion

@Anonymous 

 

From your desciption, you should:

1) unpivot both "Planned Vacation" and "Actual days taken" tables to have the months and Year in a single column each.

2) Create lookup tables with unique values for:

            a) months (include an index column for sorting purposes):  join with a one-to.many relationship to both your "Planned     Vacation" and "Actual days taken tables"

            b) years:  join with a one-to.many relationship to both your "Planned Vacation" and "Actual days taken tables"

           c) Employee ID: join with a one-to.many relationship to all your tables

3) create measures to calculate the number of [planned days],  [number of days taken] and [vacation days balance]

4) create a matrix visual using:

            a) Employee Id field from your lookup table as rows

            b) the month and year fields from your lookup tables as columns (or you can use the year field as a filter in the filter pane if             you want to restrict the data to a specific year.)

            c) include your measures as values

5) go into the formatting pane for the matrix and under "Values" select "show on rows".

Does that work?

If not please provide sample data in data format for all tables to replicate your model.





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Anonymous
Not applicable

@PaulDBrown 

Thank you for your reply. I got it to work except for the circled column.

Vacation Dashboard example - Copy.png

Here's how I arranged everything:

Rows: EmployeeInfo

Columns: Months (Single column)

Values: Planned, Actual

I have a table named Balance with the two columns: EmployeeID and LeaveBalance. I connected it to the Employee table this way:

EmployeeID in Employee table (1)-->(*) EmployeeID in Balance table

How do I get the Leave Balance to display as I want it in the image above?

amitchandak
Super User
Super User

Use power bi Matrix, with stepped layout off. Drill till the last level

 

https://www.burningsuit.co.uk/blog/2019/04/7-secrets-of-the-matrix-visual/

Refer: https://docs.microsoft.com/en-us/power-bi/visuals/desktop-matrix-visual#stepped-layout-with-matrix-v...

https://data-flair.training/blogs/power-bi-matrix-visual/

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.

Top Solution Authors