cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
mifrasmm Helper I
Helper I

DAX FUNCTION FILTER

HI,

 

i m having a table with below values, I need a count the equip id  row 's using filter Return_status ='NO' & REMARK1='DELIVERY'  & result value need - with consent value 100

 Please can u help

 

EQUIP_IDEQUIP_TYPERETURN_STATUSREMARK1
L 10573VanNODELIVERY
m 67692VanNODELIVERY
k 77921VanNODELIVERY
l 90507VanYESDELIVERY
f 88162TruckNOLOADING
k 69179VanNODELIVERY
d 22581TruckYESLOADING
p 21886VanNODELIVERY
1 ACCEPTED SOLUTION

Accepted Solutions
Ross73312 Community Champion
Community Champion

Re: DAX FUNCTION FILTER

You were sooo close.  All you need to do is make use of the OR function.  So the code would read:

 

Available = CALCULATE(
        COUNTA(EquipLive[EQUIP_ID]),
	OR(
		'EquipLive'[REMARK1]="DELIVERY",
		'EquipLive'[REMARK1]="LOADING"
	),
	'EquipLive'[RETURN_STATUS]="NO"
)

View solution in original post

6 REPLIES 6
Ross73312 Community Champion
Community Champion

Re: DAX FUNCTION FILTER

Here is what i'd write.  This is off the top of my head so you might need to put it into your Power BI and get it to check for errors:

Equip Count = Calculate(
	counta('TableName'[EQUIP_ID}),
	'TableName'[RETURN_STATUS] = "NO",
	'TableName'[REMARK1] = "DELIVERY"
)

Where 'TableName' is the name of the table that you are using

EDIT:  I should note this is intended as a measure.

 

mifrasmm Helper I
Helper I

Re: DAX FUNCTION FILTER

Hi Ross,

 

Thanks for replying , its working

 if i want include "LOADING " as well, I tried 

 

Available = CALCULATE(COUNTA(EquipLive[EQUIP_ID]),'EquipLive'[REMARK1]="DELIVERY",'EquipLive'[REMARK1]="LOADING", 'EquipLive'[RETURN_STATUS]="NO")

 

Giving no result , Please help

Ross73312 Community Champion
Community Champion

Re: DAX FUNCTION FILTER

You were sooo close.  All you need to do is make use of the OR function.  So the code would read:

 

Available = CALCULATE(
        COUNTA(EquipLive[EQUIP_ID]),
	OR(
		'EquipLive'[REMARK1]="DELIVERY",
		'EquipLive'[REMARK1]="LOADING"
	),
	'EquipLive'[RETURN_STATUS]="NO"
)

View solution in original post

mifrasmm Helper I
Helper I

Re: DAX FUNCTION FILTER

Thanks Ross for help.

OR fucntion can create max 2 arguments , if i want add one more is there any  option

Ross73312 Community Champion
Community Champion

Re: DAX FUNCTION FILTER

You are able to nest OR within OR.  If you remember doing Algrabra at school, it works like that where you resolve the innerparts of the equation and work outwards.  So lets say you had 8 things to OR, you could have a statement like:
OR(OR(OR(OR(OR(OR(OR(1,2),3),4),5),6),7),8)

it would resolve like:
Does 7 = OR(OR(OR(OR(OR(OR(OR(1,2),3),4),5),6),7),8)
OR(OR(OR(OR(OR(OR(FALSE,3),4),5),6),7),8)
OR(OR(OR(OR(OR(FALSE,4),5),6),7),8)
OR(OR(OR(OR(FALSE,5),6),7),8)
OR(OR(OR(FALSE,6),7),8)
OR(OR(FALSE),7),8)
OR(TRUE,8)
TRUE

mifrasmm Helper I
Helper I

Re: DAX FUNCTION FILTER

Thanks Ross, Go it 

Helpful resources

Announcements
Announcing the New Spanish Forum

Announcing the New Spanish Forum

Do you need help in Spanish? Check out our new Spanish community section.

MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

‘Better Together’ Integration Forum Launch

‘Better Together’ Integration Forum Launch

We've launched a how-to forum where you can learn about how Power BI integrates with other Power Platform products.

Top Solution Authors
Top Kudoed Authors