cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dw700d
Helper V
Helper V

simple filter measure

I have a list of over 5,000 Purchase order numbers. Each Purchase order can have a variety of different account codes attached to it. There are 14 account codes. I would like to Identify Purchase orders that do not have account code (10C) attached to it. For Example in the table below  Purchase order 2,4,6,8 would qualify as a purchase order that does not have account code 10C. Purchase order 1 would not qualify because although it has other account codes it also has 10C. How can I create a measure that allows me to only view purchase orders without account code 10C?

 

Purchase Order No     Acct Cd               Sum of Amt
110C9624.26
120B14209.52
120C9001.25
220D3624.93
220B26953.98
310C1750.5
420E1425.67
420D35491.18
420A2450.15
510C12901.04
620A4593.94
620B833.9
710C200
720A486.39
720B100
820A156
820C122
1 ACCEPTED SOLUTION
VahidDM
Community Champion
Community Champion

Hi @dw700d 

 

Try this measure :

Purchase <>(10C) = 
VAR _Count10C =
    CALCULATE (
        COUNT ( 'Table'[Sum of Amt] ),
        ALLEXCEPT ( 'Table', 'Table'[Purchase Order No] ),
        'Table'[Acct Cd] = "10C"
    )
RETURN
    IF ( ISBLANK ( _Count10C ), 0, _Count10C )

 

and filter the new meausre to show zero.

Output:

VahidDM_0-1632805432049.png

 

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.

Appreciate your Kudos✌️!!

View solution in original post

2 REPLIES 2
VahidDM
Community Champion
Community Champion

Hi @dw700d 

 

Try this measure :

Purchase <>(10C) = 
VAR _Count10C =
    CALCULATE (
        COUNT ( 'Table'[Sum of Amt] ),
        ALLEXCEPT ( 'Table', 'Table'[Purchase Order No] ),
        'Table'[Acct Cd] = "10C"
    )
RETURN
    IF ( ISBLANK ( _Count10C ), 0, _Count10C )

 

and filter the new meausre to show zero.

Output:

VahidDM_0-1632805432049.png

 

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.

Appreciate your Kudos✌️!!

View solution in original post

amitchandak
Super User
Super User

@dw700d , Plot this as total or with purcahse order no

 


Measure =
var _1 = calculate(sum(Table[Amt]), filter(Table, Table[Acc Cd] ="10C"))
return
countx(values(Table[Purchase Order No]), if(isblank(_1) ,[Purchase Order No], blank()))

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! !!
Dashboard of My Blogs !! Connect on Linkedin
Want To Learn Power BI
Learn Power BI Beginners !! Advance Power BI Concepts !! Power BI For Tableau User !! Learn Power BI in Hindi !!
Proud to be a Super User!

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Power BI December 2021 Update_carousel 768x460.jpg

Check it Out!

Click here to read more about the December 2021 Updates!

Jan 2022 Dev Camp 768x460 copy.png

Power BI Dev Camp- January 27th, 2022

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors