Asking About Filter

pociners

New Member
Joined
Mar 19, 2014
Messages
32
Hi Everyone It's me :D

I wanna ask something simple,
This is my data:
ynmhk.jpg


I create 3 simple calculated measure:
Code:
[B]Sales[/B]:=SUM([Qty])
Code:
[B]Stock[/B]:=1000
Code:
[B]Stock End[/B]:=CALCULATE([Stock]-[Sales],FILTER(Table1,Table1[ID]>3))

and this is the result from pivot:
1y0c4y.jpg


Well, based on my filter (Table[ID]>3), Stock end where ID <= 3 should be BLANK, but it shows 1000, why?
Can you help me?

Thanks,
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Your table filter portion of the formula only filters the table, not the contant "stock=1000". So your filter "hides" the values for id 1,2 &3 and hence they each = 0. 1,000 minus zero = 1,000.

You could do something like this.

=sumx(table1,if(table1[id]>3,[stock]-sum(Table1[Qty]))

but it as a warning, DAX can be deceivingly complex and I am not really sure why you would want to do what you are saying. If it is to learn, then sure. But if this is part of some end solution, then I am not sure it makes sense.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,158
Messages
6,176,745
Members
452,741
Latest member
Muhammad Nasir Mahmood

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