Workaround for TRUE/FALSE Expression error

KnifeandFork

New Member
Joined
Jan 9, 2014
Messages
5
Hi all!

I'm desperately trying to get PowerPivot to count the number of 'L's in a column. L itself is a measure, which returns 'L' for stores which have not bought in over a year (and are therefore Lost) and blank for all other cases. When I try the following function:

=calculate(DISTINCTCOUNT([Store]),[Lost]="L")

I get the following error:

Calculation error in measure 'Table1 1'[98cc8508-821c-4611-9777-c96938814971]: A function 'CALCULATE' has been used in a True/False expression that is used as a table filter expression. This is not allowed.

The original source file is structured as follows, so I cannot do it directly in the file, as Quarters are in rows and not columns:
CountryStoreBrandQuarterSales
ArmeniaaXQ110
ArmeniabYQ120
ArmeniacYQ127
ArmeniaaYQ174
ArmeniacXQ1206
ArmeniaaXQ260
ArmeniabYQ2215
ArmeniacXQ2191
ArmeniadYQ2197
ArmeniaeZQ2189

<tbody>
</tbody>


Any ideas?

Thanks!
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Don't make "L" a Measure. Instead, make it a new column using an IF statement and populating it with "L" or "" depending on your criteria. Then you just FILTER on the new column.
 
Upvote 0
Don't make "L" a Measure. Instead, make it a new column using an IF statement and populating it with "L" or "" depending on your criteria. Then you just FILTER on the new column.


Thanks for your suggestion. The reason I haven't done this is because, as quarters are not in columns but rows, it would mean for each row referencing back to the previous quarter sales for that store, the next column two quarters back, etc... and then including yet another column with the totals. Not to mention that as each country has repeated entries for each quarter each time there's sales for every type of brand, the past values would also have to reference the brand. As I have close to 1 MM rows, this isn't really feasible.

I'd need to do something like:
CountryStoreBrandQuarterSalesQuarter Ago & Brand ConcatQuarter Ago Sales2 Quarter Ago & Brand Concat2 Quarter Ago Sales3 Quarter Ago & Brand Concat3 Quarter Ago Salesetc…SumLost?
ArmeniaaXQ110reference to previous brand and quarter
ArmeniabYQ120
ArmeniacYQ184
ArmeniaaYQ1244
ArmeniacXQ1194
ArmeniaaXQ2341
ArmeniabYQ2237
ArmeniacXQ2165
ArmeniadYQ2298
ArmeniaeZQ230

<tbody>
</tbody>
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,235
Messages
6,123,792
Members
449,126
Latest member
Greeshma Ravi

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