+ Reply to Thread
Results 1 to 8 of 8

DAX Formula in PivotTable gives wrong Total Sales Value

  1. #1
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,060

    DAX Formula in PivotTable gives wrong Total Sales Value

    Hi all, I have built a PivotTable with Data Model and defined my Sales Value as:
    =[Sum of Sales Qty]*[Sum of Selling Price] with DAX formula.

    [Grand Total of Sales Value] should be [Sum of Sales Value], instead it is showing [Sum of Sales Qty]*[Sum of Selling Price.]. How do I correct it?

    Please help! Thank you!
    Joseph

  2. #2
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: DAX Formula in PivotTable gives wrong Total Sales Value

    Hi,

    The current total is perfectly correct, in the sense that it is consistently applying the logic of the measure to the total row.

    To override this default behaviour, you could use:

    Sales Value:=IF(HASONEVALUE(ProdSales[Product]),[Sum of Sales Qty]*[Sum of Selling Price],SUMX(ProdSales,ProdSales[Sales Qty]*[Sum of Selling Price]))

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  3. #3
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,060

    Re: DAX Formula in PivotTable gives wrong Total Sales Value

    Thank you, XOR LX! Is there anyway to also not show the Grand Total for Sum of Selling Price?

    DAX Formula in PivotTable gives wrong Total Sales Value.png

  4. #4
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: DAX Formula in PivotTable gives wrong Total Sales Value

    You mean you just want it to be blank instead?

    Regards

  5. #5
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,060

    Re: DAX Formula in PivotTable gives wrong Total Sales Value

    That's right.

  6. #6
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: DAX Formula in PivotTable gives wrong Total Sales Value

    You'll have to create a new measure and include that in the pivot:

    New Selling Price:=IF(HASONEVALUE(ProdMaster[Selling Price]),[Sum of Selling Price],BLANK())

    Regards

  7. #7
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,060

    Re: DAX Formula in PivotTable gives wrong Total Sales Value

    Thanks XOR LX, work perfectly! Rep added!

  8. #8
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: DAX Formula in PivotTable gives wrong Total Sales Value

    You're welcome!

    Cheers

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Needing to track total sales per product...not per sales person or per month
    By DrakeZun in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-06-2021, 11:03 PM
  2. Replies: 10
    Last Post: 02-21-2019, 10:42 AM
  3. [SOLVED] Help! Need variable daily sales targets to total monthly sales goal
    By Chronohog in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-31-2018, 02:54 PM
  4. [SOLVED] Formula to total the sales of all product with condition
    By Manish_Gupta in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-13-2017, 02:05 AM
  5. Replies: 1
    Last Post: 12-01-2013, 12:21 PM
  6. Replies: 1
    Last Post: 11-19-2013, 12:52 PM
  7. formula to calculate sales tax from total sales
    By Deanna in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 10-05-2005, 04:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1