Two different measures on the same Powerpivot report column

kdankwah

New Member
Joined
Apr 8, 2013
Messages
17
I need an advice on how to do this. I have a Power-pivot summary report that I create every month. 90% of the report row uses this measure for the column MTD:

=CALCULATE (SUM([AMOUNT]),

FILTER (
ALL ( DATE ),
'Date'[YearMonthNumber]= MAX ( 'Date'[YearMonthNumber] )
&& 'Date'[Date] <= MAX ( 'Date'[Date] )
)
)

and the YTD measure is:

=CALCULATE (SUM([AMOUNT]),
FILTER (
ALL ( DATE ),
'Date'[YearNumber] = MAX ( 'Date'[YearNumber] )
&& 'Date'[Date] <= MAX ( 'Date'[Date] )
)
)

This is working perfectly.


The problem is one of the rows in the report will have a different measure, I am using an IF statement below to extract the mtd and ytd figures if the code is OADPO.

=if('Combined Years Dataset'[SOURCE]="OADPO", DatesMTD(date[date]))


I don't know how that will work, its not working anyway. Is this possible in a report?

Can someone please help me formulate all three measures into one measure?

Thanks in advance.
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Disregard the last statement, Correction I want to formulate the last If statement measure to the MTD and the YTD to create the two columns.

Thanks
 
Last edited:
Upvote 0
You will want something like this:

Code:
=IF (HASONEVALUE('Combined Years Dataset'[SOURCE]),
      IF (VALUES('Combined Years Dataset'[SOURCE] = "OADPO"),
              [MTD],
              [YTD]
       )
   )

This IF check is to avoid passing multiple values to VALUES() in the grand total cell (which causes blow up). Can also be used to do something different in those total cells
 
Upvote 0
You will want something like this:

Code:
=IF (HASONEVALUE('Combined Years Dataset'[SOURCE]),
      IF (VALUES('Combined Years Dataset'[SOURCE] = "OADPO"),
              [MTD],
              [YTD]
       )
   )

This IF check is to avoid passing multiple values to VALUES() in the grand total cell (which causes blow up). Can also be used to do something different in those total cells

Thank you so much. I appreciate your help. I have thought of doing it sthis way too. I will create two different pivot table reports one for regular and the other for the Purchase Order report. I will then use OLAP cubes to combine and rearrange them. Is my approach OK.

Thanks once again.
 
Upvote 0
Sorry, I don't totally understand your scenario, so it's hard for me to say. I don't know what is in "regular" report and PO report, or what you hope to "combine" about them... :)
 
Upvote 0

Forum statistics

Threads
1,214,932
Messages
6,122,332
Members
449,077
Latest member
jmsotelo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top