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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
PK_PBIBoss
Frequent Visitor

Matrix showing weird behavior while adding fields under Rows :-

I have a table and need to apply sensitivity on Year 2020 it works fine with all values coming :-

 

Base Data  - 

GroupFinancial Item201820192020
OINet Interest177179164
OIFee7911
TIOper Inc184188175
TIInc All-7-44
TotalTotal Inc177184179

If I dont use the group column and create the matrix with slicers itworks fine :-

 

 Slicer Net IntSlicerFee  
 25%-15%  
Financial Item201820192020Rev-2020
Net Interest177179164205
Fee79119.35
Oper Inc184188175214.35
Inc All-7-444
Total Inc177184179218.35

 

Measure Formula :- 

WB_APAC_RFC_Perct =
VAR X1 = DIVIDE(
CALCULATE(SUM(WB_APAC[RFC 2020]),WB_APAC[Financial Item]="Net Interest"),
CALCULATE(SUM(WB_APAC[RFC 2020]),WB_APAC[Financial Item]="Operating Income"),1)

VAR X2 = DIVIDE(
CALCULATE(SUM(WB_APAC[RFC 2020]),WB_APAC[Financial Item]="Fee"),
CALCULATE(SUM(WB_APAC[RFC 2020]),WB_APAC[Financial Item]="Operating Income"),1)

VAR X3 = DIVIDE(
CALCULATE(SUM(WB_APAC[RFC 2020]),WB_APAC[Financial Item]="Other"),
CALCULATE(SUM(WB_APAC[RFC 2020]),WB_APAC[Financial Item]="Operating Income"),1)

RETURN
SUMX(WB_APAC, IF(WB_APAC[Financial Item] = "Net Interest" , WB_APAC[RFC 2020] * (1+ 'Net Interest Parameter'[Net Interest Parameter Value]),
IF(WB_APAC[Financial Item] = "Fee" , WB_APAC[RFC 2020] * (1+ 'Fee Parameter'[Fee Parameter Value]) ,
IF(WB_APAC[Financial Item]= "Operating Income" , WB_APAC[RFC 2020] + (((X1*WB_APAC[RFC 2020]) * 'Net Interest Parameter'[Net Interest Parameter Value]) + ((X2*WB_APAC[RFC 2020]) * 'Fee Parameter'[Fee Parameter Value]) 8),WB_APAC[RFC 2020])))))

 

But when I add group to matrix :- The Operating Income does not get calculated :-

 

  Slicer Net IntSlicerFee  
  25%-15%  
GroupFinancial Item201820192020Rev-2020
OINet Interest177179164205
OIFee79119.35
TIOperating Income184188175175
TIIncome Allocated-7-444
 Total177184179179

 

2 REPLIES 2
v-lionel-msft
Community Support
Community Support

Try this measure.

WB_APAC_RFC_Perct = 
VAR X1 = 
DIVIDE(
    CALCULATE(SUM(WB_APAC[RFC 2020]),WB_APAC[Financial Item]="Net Interest"),
    CALCULATE(SUM(WB_APAC[RFC 2020]),WB_APAC[Financial Item]="Operating Income"),
    1
)

VAR X2 = 
DIVIDE(
    CALCULATE(SUM(WB_APAC[RFC 2020]),WB_APAC[Financial Item]="Fee"),
    CALCULATE(SUM(WB_APAC[RFC 2020]),WB_APAC[Financial Item]="Operating Income"),
    1
)

VAR X3 = 
DIVIDE(
    CALCULATE(SUM(WB_APAC[RFC 2020]),WB_APAC[Financial Item]="Other"),
    CALCULATE(SUM(WB_APAC[RFC 2020]),WB_APAC[Financial Item]="Operating Income"),
    1
)

RETURN
SUMX(
    ALL(WB_APAC), 
    IF(
        WB_APAC[Financial Item] = "Net Interest" , 
        WB_APAC[RFC 2020] * (1+ 'Net Interest Parameter'[Net Interest Parameter Value]),
        IF(
            WB_APAC[Financial Item] = "Fee" , 
            WB_APAC[RFC 2020] * (1+ 'Fee Parameter'[Fee Parameter Value]) ,
            IF(
                WB_APAC[Financial Item]= "Operating Income" , 
                WB_APAC[RFC 2020] + (  X1*WB_APAC[RFC 2020] * 'Net Interest Parameter'[Net Interest Parameter Value] + X2*WB_APAC[RFC 2020] * 'Fee Parameter'[Fee Parameter Value] ),
                WB_APAC[RFC 2020]
            )
        )
    )
)

If the correct value is still not returned, this may be a problem with the following code.

v-lionel-msft_0-1594796524555.png

Do you mind sharing your .pbix file?

 

Best regards,
Lionel Chen

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

 

amitchandak
Super User
Super User

@PK_PBIBoss , You should Unpivot the table and then you should use it.

https://radacad.com/pivot-and-unpivot-with-power-bi
Transpose : https://yodalearning.com/tutorials/power-query-helps-transposing-data/

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
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.