Forum

Notifications
Clear all

Calculated fields

8 Posts
2 Users
0 Reactions
59 Views
(@raman)
Posts: 33
Trusted Member
Topic starter
 

Hi Mynda

 

I have 3 tables - 1. Trial balance with ledger accounts 2. Master table with ledgers and groupings 3. Budget for group of accounts

I created a profit & loss a/c in pivot table using data model adding the above 3 tables containing actual and budgeted figures.

                                    Actual            Budget for remaining months                  Total for the year

1. Sales                         XXX                            XXX                                              XXX

2. Purchases                  XXX                            XXX                                              XXX

3. Direct exp                 XXX                             XXX                                              XXX

4. Fixed exp                  XXX                             XXX                                              XXX

 

From above rows, I would like to calculate Gross profit (Sales minus purchases minus direct exp) and Net profit (Gross profit minus fixed exp)

In normal pivot table, I am able to get it by using calculated fileds.  But in pivot table with data model I am unable to find the calculated fileds.  Pls help.

 
Posted : 03/01/2021 11:27 pm
(@catalinb)
Posts: 1937
Member Admin
 

Hi Thulasi,

For Gross Profit, should be something like this:

Sales=CALCULATE(SUM(ValuesTable[Actual], ValuesTable[Category]="Sales")
DirExp=CALCULATE(SUM(ValuesTable[Actual]), ValuesTable[Category]="Direct exp")

FixedExp=CALCULATE(SUM(ValuesTable[Actual]), ValuesTable[Category]="Fixed exp")

GP=[Sales]-[DirExp]

NET=[Sales]-[DirExp]-[FixedExp]

 
Posted : 04/01/2021 12:55 am
(@raman)
Posts: 33
Trusted Member
Topic starter
 

Hi Catalin Bombea

Thanks for your reply and suggestion.  But I am sorry to say that I am unable to follow it.

Sales, Direct exp, fixed exp are rows in the pivot table.  I would like to insert the image of the PT.  How to insert it here, pls guide.

 
Posted : 05/01/2021 9:05 am
(@catalinb)
Posts: 1937
Member Admin
 

Hi Thulasi,

Below message editor, there is an Attachments button.

Instead of an image, please upload a sample file with your data structure, it will be easier to work on a real example.

 
Posted : 05/01/2021 9:24 am
(@raman)
Posts: 33
Trusted Member
Topic starter
 

Hi Catalin Bombea

Thanks.  I will attach the file for more clarification of my query.  Thanks a lot.

 
Posted : 05/01/2021 10:15 am
(@raman)
Posts: 33
Trusted Member
Topic starter
 

Hi Catalin Bombea

I have uploaded file for your reference.

 
Posted : 05/01/2021 10:36 am
(@catalinb)
Posts: 1937
Member Admin
 

Hi Thulasi,

A calculated field in a normal pivot does not add the results below row fields a new rows, it is added as a calculated column.

You can try cube formulas in normal cells, above your pivot:
=GETPIVOTDATA("[Measures].[TOTAL]",$A$1,"[Masters].[PrimaryGroup]","[Masters].[PrimaryGroup].&[Sales Accounts]")

=GETPIVOTDATA("[Measures].[TOTAL]",$A$1,"[Masters].[PrimaryGroup]","[Masters].[PrimaryGroup].&[Duty Drawback]")

combine such formulas to make your totals calculation

 
Posted : 06/01/2021 11:42 pm
(@raman)
Posts: 33
Trusted Member
Topic starter
 

Thanks.  Let me try.

 
Posted : 17/01/2021 1:26 am
Share: