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
dogburalHK82
Helper III
Helper III

filter parameter in dax

Hi, 

 

I am trying to filter except for 'Late window'. 

 

OTD_PO_Total_Line(OTIF)% ALL = calculate([OTD_PO_Total_Line (OTIF) %],  allexcept('Late Window','Late Window'[Late Window]))
 
This 'Late window' was created from parameter that contains only a single column from 1 to 10. 
 
I have got error like below; obviouse the parameter has a single column. In this case, what is the alternative way to filter all except "Late window"?

dogburalHK82_0-1685511976336.png

 

1 ACCEPTED SOLUTION

8 REPLIES 8
dogburalHK82
Helper III
Helper III

@tamerj1 Thank you

tamerj1
Super User
Super User

Hi @dogburalHK82 

please clarify how do you want the measure calculation to change with the parameter? Please provide more details about your report and data model. 

@tamerj1 

dogburalHK82_1-1685540433797.png

 

PO No.Item NumberOrder DateDue dateReceipt dateOrder quantityReceipt Quantitydays diff

P1Part_11/01/202330/05/202331/05/2023551
P2Part_21/02/202330/05/202329/05/202355-1
P3Part_31/01/202330/05/20235/05/202355-25
P4Part_41/01/202330/04/202330/05/20235530

 

say, with above raw data, i want to calculate on time delivery of shipment. 

 

I have set 2 parameter, called "early" and "late". With that, below measure has been generated. 

OT =

var _early = calculate(countA(Table1[Item Number]), filter(Table1, (Table1[days diff])<(-early[early Value])))
var _late = calculate(countA(Table1[Item Number]), filter(Table1, (Table1[days diff])>(late[late Value])))
var _OT = calculate(countA(Table1[Item Number]), filter(Table1, (Table1[days diff])>=(-early[early Value])&&(Table1[days diff])<=(late[late Value])))
var _sum = distinctcount(Table1[PO No.])
Return divide(_OT, _Sum,0)
 
dogburalHK82_0-1685540283431.png

 

Now I want to ignore all filters except for "late" and "early" parameter. 
I would like to how to set a measure. 

@dogburalHK82 
Pleasr try

CALCULATE ( [OT], REMOVEFILTERS ( ) )

@tamerj1 that ignored all filters. When changing early or late parameter, it does not work. 

Just like ALL() inside calculate. 

 

dogburalHK82_1-1685571943281.png

 

 

@dogburalHK82 

Can you share a sample file?

@tamerj1 please see if you can down

https://filebin.net/96iyutj39jjhepsw 

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.

Top Solution Authors