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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
TKBI
Regular Visitor

Custom Matrix Table

Hi,

i am fairily new to Power BI so this is maybe a problem with a very obvious solution.

 

My problem is the following:

I have two Datasets loaded into my modell. One for actual sales data and one for budget sales data. The tables have no relationship and look something like this:

Actual Data:

DateQuantityValue
12-2022     1100
01-2023     4400
02-2023     3250

 

Budget Data:

DateQuantityValue
12-2022     3300
01-2023     2120
02-2023     6500

 

So far i had an excel document that visualized the data like this:

 

 ActualBudgetdifferencedifference %
Quantity811-3-27,2%
Value750920-170-18,5%
avg. Value93,7583,6410,1112%

 

I would really like to recreate the exact visual in Power BI but so far i came up with nothing. I assume this can be done via a custom matrix table and i found https://community.fabric.microsoft.com/t5/Community-Blog/Creating-a-custom-or-hybrid-matrix-in-Power... this guide explaining how to create one. Sadly there are a few differences from my problem to the example in the guide (differences like i dont use an existing dimension for the rows) and i am not experienced enough yet to compensate for that.

 

I would really appreciate any help i could get.

 

Thank you very much!

 

1 REPLY 1
TKBI
Regular Visitor

So far I created two custom tables, one for the rows and another one for the columns using an idex in both tables.

These tables give me the columns and rows in the Matrix I need, but now the problem is to assign the right value to the right Row-Column pair.

I tried to put the Value-Actual measure into one field of the Matrix with following Dax Code:



Values for Matrix =
VAR calc = IF(
        SELECTEDVALUE(vt_columns[Index]) = 1,
             [Value_Act], 0
             )
Return
calc
 
This worked partly as i got the the measure to appear in the Row-Column pair with Index ID 1,1, but I am unsure how to adjust the code to get the other measures to appear in the field 2,3 for example.


Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.