cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Creating a new table based on multiple criteria

I am trying to create a new table based on 2 filter criteria:

 

1) The ScopeStatus has to = Green

2) ProjectPhase has to = Completed

 

If the 2 criteria are not met, then it will not show up on the new table. Any help is greatly appreciated! Thanks!

Image of Tables.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User V
Super User V

Re: Creating a new table based on multiple criteria

Hi @dandywong,


Your parentesis are misplaced so the all function is.working incorrectly.

The measure should be

Test Table =
FILTER (
    ALL (
        Projects[ProjectIdentifier],
        Projects[ProjectPhase],
        Projects[EnterpriseProjectTypeDescription],
        Projects[ScopeStatus]
    ),
    Projects[ProjectPhase] = "Completed"
        && Projects[ScopeStatus] = "Green"
)



I also notice that you were missing the Project ScopeStatus on your ALL formula without it the filter wouldn't had context and the result would be incorrect.

Regards
MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog:

Power BI em Português





View solution in original post

6 REPLIES 6
Highlighted
Super User V
Super User V

Re: Creating a new table based on multiple criteria

Hi @dandywong,

 

If you are on the query Editor you just need to Reference the query to the initial one and then add a filter on the columns you need.

 

On dax add a new table with the following code:

Table =
FILTER (
    ALL ( Projects[Project1]; Projects[ProjectPhase]; Projects[ScopeStatus] );
    Projects[ProjectPhase] = "Completed"
        && Projects[ScopeStatus] = "Green"
)

On the ALL sintax add all the columns you want to pass to the new column from the previous one.

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog:

Power BI em Português





Highlighted
Frequent Visitor

Re: Creating a new table based on multiple criteria

Hi there,

 

I tried this formula, but it didn't work:

 

Error.PNG

 

Any idea on how to fix this?

Highlighted
Super User V
Super User V

Re: Creating a new table based on multiple criteria

Hi @dandywong,

 

You need to take out the comma after "Green". The && cannot be preceded by a comma.

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog:

Power BI em Português





Highlighted
Frequent Visitor

Re: Creating a new table based on multiple criteria

Thanks MFelix!!!!

 

Sorry, I think I'm missing something....

 

Error 2.PNG

 

Still getting an error.

Highlighted
Super User V
Super User V

Re: Creating a new table based on multiple criteria

Hi @dandywong,


Your parentesis are misplaced so the all function is.working incorrectly.

The measure should be

Test Table =
FILTER (
    ALL (
        Projects[ProjectIdentifier],
        Projects[ProjectPhase],
        Projects[EnterpriseProjectTypeDescription],
        Projects[ScopeStatus]
    ),
    Projects[ProjectPhase] = "Completed"
        && Projects[ScopeStatus] = "Green"
)



I also notice that you were missing the Project ScopeStatus on your ALL formula without it the filter wouldn't had context and the result would be incorrect.

Regards
MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog:

Power BI em Português





View solution in original post

Highlighted
Frequent Visitor

Re: Creating a new table based on multiple criteria

Thank you MFelix! That did the trick!

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Upcoming Events

Experience what’s next for Power BI

See the latest Power BI innovations, updates, and demos from the Microsoft Business Applications Launch Event.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

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

Top Solution Authors