Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
dw700d
Post Patron
Post Patron

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
Super User
Super User

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
Super User
Super User

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✌️!!

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()))

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.