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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Guppi
New Member

Incorrect Grand Total In Power Pivot

Hi, guys. I'm having difficulties about this grand totals. I have a pivot table like this down below. 

 

DC/UnitCustomer GroupActual Maret 2024Price1
ARMABC5.564.000,00200.000,00
 CV. MAS AGUNG2.670.000,00 
 CV. SANTOSA JAYA15.590.000,00900.000,00
 CV. TRI JAYA4.920.000,00 
 HANAN FITRIA6.064.000,00200.000,00
 INDRA HARYO22.300.000,001,00
 MAS AGUNG SUKUN768.000,00 
 ORBIT JAYA9.000.000,00200.000,00
 PELANGI MEUBEL - DAMPIT1.500.000,00 
 PT. PURWA ASRI LESTARI937.000,00 
 RAMA MOJOKERTO760.000,00 
 RAMAH JAYA26.380.000,001,00
 SUMBER TEKNIK6.000.000,00200.000,00
 TK. FARIDA JAYA PLASTIK13.100.000,00500.000,00
 TK. HOO6.624.000,00200.000,00
 TK. MEGA JAYA ELEKTRONIK5.700.000,00200.000,00
 TK. MORO SENENG4.900.000,00 
 TK. PLASTIK LANCAR JAYA7.112.000,00200.000,00
 TK. SUMBER JAYA 2 - MAGERSARI12.679.000,00500.000,00
 UNTUNG BERSAMA11.160.000,00500.000,00
 WINNERS5.802.000,00200.000,00
ARM Total169.530.000,0012,00

 

This pivot table is created using 4 tables: DIMDATE, SALES, HADIAH, and STORE.

The DIMDATE[DATE] column has one to many relationship with SALES[DATE] column,
STORE[CODE] column has one to many relationship with SALES[CUSTOMER CODE] column,

HADIAH[TARGET] column also has one to many relationship with STORE[TARGET] column

 

The Actual Maret 2024 column is created using a simple measure like this:

CALCULATE([SUM OF NETTO]; DIMDATE[MONTH NAME] = "MAR")

So far, this column grand total is correct.

Then I created a Price1 column using this measure:

VAR ACTUAL = [Actual Maret 2024]

 

VAR AMACTH =

LOOKUPVALUE(

HADIAH[TARGET];

HADIAH[TARGET]; CALCULATE(MAX(HADIAH[TARGET]); HADIAH[TARGET] <= ACTUAL))

 

VAR APRICE =

LOOKUPVALUE(

HADIAH[HADIAH];

HADIAH[TARGET];

AMATCH)

 

RETURN

APRICE

 

So basicly this measure calculate if the HADIAH[TARGET] column is less than ACTUAL MARET 2024 then return the coresponding HADIAH[HADIAH] column.

 

The HADIAH table is like this:

TargetHadiah
5.000.000,00200.000,00
10.000.000,00500.000,00
15.000.000,00900.000,00
20.000.000,001,00
35.000.000,002,00
50.000.000,003,50
75.000.000,005,50
150.000.000,0012,00
250.000.000,0022,00

 

I also have tried this measure:

 

VAR ACTUAL = [Actual Maret 2024]

 

VAR AMACTH =

LOOKUPVALUE(

HADIAH[TARGET];

HADIAH[TARGET]; CALCULATE(MAX(HADIAH[TARGET]); HADIAH[TARGET] <= ACTUAL))

 

VAR APRICE =

LOOKUPVALUE(

HADIAH[HADIAH];

HADIAH[TARGET];

AMATCH)

 

RETURN
SUMX(
        SUMMARIZE(

        STORE;

        STORE[DC/UNIT];

        STORE[CUSTOMER GROUP];

        "TOTAL";

         APRICE);

         [TOTAL]

         )

but the grand total is also incorrect, too much incorrect.

 

The Price1 column grand total should be = 4.000.002

 

Where am I doing wrong?

I hope I provide enough data, so you guys can help me out. Many thanks

 

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

HI @Guppi,

It seems like a common measure total issue when you use measure expression to calculate with multiple aggregations, you can take a look at the Greg’s blog to know how to handle this scenario:

Measure Totals, The Final Word 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

1 REPLY 1
v-shex-msft
Community Support
Community Support

HI @Guppi,

It seems like a common measure total issue when you use measure expression to calculate with multiple aggregations, you can take a look at the Greg’s blog to know how to handle this scenario:

Measure Totals, The Final Word 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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