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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
ChirSidh
Helper II
Helper II

Unique Filter with threeway matching - New Column

My data set has a Category (Project Number), Sub Category (Work order number), Close Status ( True/False).
One project has many work orders, what i would like to filter is If all the work orders of a close status is False then only it should filter the project name, even if one close status is also True then it should not filter. 
Please help me with column formula

 

Unique Filter.JPG

7 REPLIES 7
ChirSidh
Helper II
Helper II

Hi vanessafvg yes it would be good if the result is limited to first row of project number rest of the rows for the particular project  should be empty 

 

Also, can you please look at my other post as well, where i mentioned that I have used this formula in my dataset which is very large, i dont know for some strange reason each row is getting repeated 176 times, am i doing any mistake here?

1 Result =
2 var Project = SELECTEDVALUE(PFT[ Project])
3 var Result = CALCULATE(max(PFT[ Project]),ALLEXCEPT('PFT',PFT[ Project]), PFT[Close?]= FALSE())
4 Return Result
ChirSidh
Helper II
Helper II

I have used this formula in my dataset which is very large, i dont know for some strange reason each row is getting repeated 176 times, am i doing any mistake here?

Result =
var project = SELECTEDVALUE(PFT[ Project])
var result = CALCULATE(max(PFT[ Project]), ALLEXCEPT(PFT,PFT[ Project]), PFT[Close?] = "FALSE")
Return result

 

vanessafvg
Super User
Super User

please see pbix attached and let me know if you have any questions.

 

this is the code i used

 

Result =
var project = SELECTEDVALUE('Table'[Project])
var result = CALCULATE(max('Table'[Project]), ALLEXCEPT('Table','Table'[Project]), 'Table'[Close?] = FALSE())
Return result

 

 





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Thank you Vanessafvg, this works, however the result gets repeated in the rows, is there anyway we can show one project number just at one time like we do in Excel with Unique(filter) formula

I am not a excel developer, I work on big data models so I am not sure entirely sure what you mean.   are you saying you only want it to return for one row as it does in your screensshot ?  can you explain to me a litte bit more of what you are trying to do by only returning it once.  If it must be returned once which row?   

 

Power bi is a tabular data model, it doesnt work in the same way as excel.  When it assess the result it will do that for each row and it will return data for each row.   If you need it to return for only one row you will need to tell it which row to return it to





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




ChirSidh
Helper II
Helper II

 Project	Work Order No	Close?	Expected Result
82100251	82100251-012	FALSE	82100251
82100251	82100251-012	FALSE	
82100251	82100251-013	FALSE	
82100251	82100251-014	FALSE	
82100251	82100251-015	FALSE	
72103803	72103803-159	TRUE	
72103803	72103803-163	TRUE	
72103803	72103803-178	TRUE	
72103803	72103803-184	TRUE	
72103803	72103803-189	TRUE	
72103803	72103803-197	TRUE	
72103803	72103803-200	TRUE	
72103804	72103804-189	TRUE	72103804
72103804	72103804-197	FALSE	
72103804	72103804-200	TRUE	
90005981	90005981-100	TRUE	
90005981	90005981-400	TRUE	
90009205	90009205-105	FALSE	90009205
90009205	90009205-106	TRUE	
90009205	90009205-107	TRUE	
​
 ProjectWork Order NoClose?Expected Result
8210025182100251-012FALSE82100251
8210025182100251-012FALSE 
8210025182100251-013FALSE 
8210025182100251-014FALSE 
8210025182100251-015FALSE 
7210380372103803-159TRUE 
7210380372103803-163TRUE 
7210380372103803-178TRUE 
7210380372103803-184TRUE 
7210380372103803-189TRUE 
7210380372103803-197TRUE 
7210380372103803-200TRUE 
7210380472103804-189TRUE72103804
7210380472103804-197FALSE 
7210380472103804-200TRUE 
9000598190005981-100TRUE 
9000598190005981-400TRUE 
9000920590009205-105FALSE90009205
9000920590009205-106TRUE 
9000920590009205-107TRUE 
vanessafvg
Super User
Super User

please provide the data in text format so its easy to copy and paste into a power bi file and do this for you.





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.