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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
motyagi
Helper I
Helper I

Grand Total In power BI matrix doesn't match

Hi There, 

 

I have a Table and the grand totals for a measure dont match up. i.e If I add each row in the table in excel it doesn't give me the same result as Power BI. 

 

How can i fix this ? Please Help !!!

 

1 ACCEPTED SOLUTION
Vvelarde
Community Champion
Community Champion

@motyagi

 

Hi, try with this measure:

 

Result-CostExpectation =
IF (
    HASONEVALUE ( Table1[Project ] );
    [CostExpectationM];
    SUMX ( VALUES ( Table1[Project ] ); [CostExpectationM] )
)

Regards

Victor




Lima - Peru

View solution in original post

8 REPLIES 8
sqlguru448
Helper III
Helper III

Can you provide sample data where you have issue?

Project NI PY Total PYNI % I CY Cost Expectation 
A16302417437123767943.91%104112029185628247.3
B4231099711587985436.51%3679047457949449.39
C2139526613846731915.45%4847409357332877.72
D390563314003412.44%13747351570016.429
Total22712100062872488636.12%190751331298627859.5

 

Cost Expectation  = ICY/(1-NI %) 

The grand total is performing this at the grand total level row I just need it to add it for all the Projects so the sum is 302480591. 

 

Thanks

ss.PNG

I am not sure what exact relationship you have in your modeling, but when I tried to populate and apply the formula for cost expectation. I was able to see the correct Grand Total.

 

Screenshot Above.

 

 

My cost expectation is a measure and not a calculation cause of I am trying to avoid circular dependencies.

 

Can anyone help me with this request ?

Vvelarde
Community Champion
Community Champion

@motyagi

 

Hi, try with this measure:

 

Result-CostExpectation =
IF (
    HASONEVALUE ( Table1[Project ] );
    [CostExpectationM];
    SUMX ( VALUES ( Table1[Project ] ); [CostExpectationM] )
)

Regards

Victor




Lima - Peru

Thank You so much Victor !!!! Smiley Happy

89898
Frequent Visitor

Hello @ Vvelarde , I am facing the same issue even though I applied the same formulas. My total number is still not sum up correctly for row and columns totals. Below is my sample data.

Table A    
RegionPO NumberInvoice QTYReceive QTYUnit Costs
AABC3280
AABC1280
BCDE23100
BCDE23100
CEFG5890
CEFG1890

 

Measurement created     
RegionPO Numbersum- Invoice QTYAverage Receive QTYRemaining QTYAverage unit costsTotal costs
AABC42280160
BCDE431100100
CEFG68-2900

 

Measurement I created :

1. sum- Invoice QTY= sum(Invoice QTY)

2. Average Receive QTY = Average (Receive QTY)

3. Remaining QTY = [sum-Invoice QTY]-[Average Receive QTY)

4. Total costs = if([Remaining QTY]<0,0,([Remaining QTY]*[Average unit costs]))

5. Total costs (to be used in Power BI matrix) = if(COUNTROWS(Values(TableA[PO Number]))=1,[Total Costs],sumx(values(Table A[PO Number]),[Total costs]))

i tried countrows and hansonvalue, both appear the same result.

Appreciate if anyone can help on this issue.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.