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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Evandam
Helper II
Helper II

add measured /calculated value in matrix row

Hi,

 

i have an export of financial data (journal entries). Based on the GL account i have dfined a higher hiearchy level. I allready created a mapping table that contains all the GL accounts with a mapping to the correct hiearchy level.

 

reference table

mapping tablemapping table

data model

data modeldata model

 

if i now create a table it looks like this:

table.jpg

1 omzet = revenue

2 KP omzet = Cost of goods sold

 

as you might notice there is no reference number 3, 6 and also no 9.

reference number 3 should be the gross margin and can be calculated by subtracting total of ref 2 from ref 1.

so 861.320 minus 675.386=185.934

 

My question comes down to this:

"how can i display reference number 3 in the same table"..

so it should look like this:

 

example 1.jpg

 

what is the best approach for this?

perhaps creation another table in which measures are stored on a row level. Using Calculate + sum in an IF statemet to calculate the total amount per reference number (1,2,4,5,7,8).

Then use the calculated values to (1,2,4,5,7,8) to calculate reference numbers 3, 6 and 9??

3 = 1 minus 2

6 = 3 minus (4+5)

9 = 6 minus (7+8)

 

 

Thanks!

Erwin

4 REPLIES 4
Evandam
Helper II
Helper II

update:

calculating the the total amounts based on reference number have worked.

but when i make an active realtion between tables the calculations for reference 3,6,9 disappear

 

no relation
no relationno relation

 

 

active relation

active relationship between mapping and calculation.jpg

 

syntax of calculation

 

Actuals YTD = 
IF('calculations'[reference number]=1;
    CALCULATE(SUM('Journal Entries'[total amount]);Mapping[reference number]=1);

IF('calculations'[reference number]=2;
    CALCULATE(SUM('Journal Entries'[total amount]);Mapping[reference number]=2);

IF('calculations'[reference number]=4;
    CALCULATE(SUM('Journal Entries'[total amount]);Mapping[reference number]=4);

IF('calculations'[reference number]=5;
    CALCULATE(SUM('Journal Entries'[total amount]);Mapping[reference number]=5);

IF('calculations'[reference number]=7;
    CALCULATE(SUM('Journal Entries'[total amount]);Mapping[reference number]=7);

IF('calculations'[reference number]=8;
    CALCULATE(SUM('Journal Entries'[total amount]);Mapping[reference number]=8);

IF('calculations'[reference number]=3;
        CALCULATE(SUM('Journal Entries'[total amount]);Mapping[reference number]=1)
        -
        CALCULATE(SUM('Journal Entries'[total amount]);Mapping[reference number]=2);

IF('calculations'[reference number]=6;
        CALCULATE(SUM('Journal Entries'[total amount]);Mapping[reference number]=1)
        -
        CALCULATE(SUM('Journal Entries'[total amount]);
        OR(OR(Mapping[reference number]=2;Mapping[reference number]=4);Mapping[reference number]=5));



IF('calculations'[reference number]=9;
        CALCULATE(SUM('Journal Entries'[total amount]);Mapping[reference number]=1)
        -
        CALCULATE(SUM('Journal Entries'[total amount]);
        OR(OR(OR(OR(
            Mapping[reference number]=2;
            Mapping[reference number]=4);
            Mapping[reference number]=5);
            Mapping[reference number]=7);
            Mapping[reference number]=8));

0)))))))))

 

@amitchandak 
maybe this info will be helpfull to further understand the situation

 

amitchandak
Super User
Super User

@Evandam , Make sure the reference number is present in the dimension

 

Then create measure like

Switch( true() ,

Max(Mapping [Reference]) =3,

calculate([measure] , Mapping [Reference] =2) -calculate([measure] , Mapping [Reference] =1)

Max(Mapping [Reference]) =6,

(calculate([measure] , Mapping [Reference] =2) -calculate([measure] , Mapping [Reference] =1) ) -

calculate([measure] , Mapping [Reference] =4) + calculate([measure] , Mapping [Reference] =5)

Max(Mapping [Reference]) =9,

<Add for 9>,

[Measure]

)

 

It will be a very similar approach like

Power BI Modeling- Unselected values as others - https://youtu.be/HX4pgexYwf4

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

Hi @amitchandak 

thanks for your reply.
unfortunatly it is not very usefull in my case.

 

mapping table is just a table in wich all GL accounts are mapped to reference number (280 rows in total).

So i will not work to just put reference number 3,6 and 9 in this table and then calculate the total amount for these reference numbers via the measure you suggested...

thanks any way:)

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.