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
JQuon
Helper I
Helper I

Use WHERE condition in DAX with Union and Selectcolumns?

I've created a calculated table that takes information from 5 different tables and consolidates it into 3 appended columns (Category, Name, Complete Date) on a single table.  The calculated table was created using Filter, Union, and selectcolumns.  The filter returns all items that are  not BLANK in the "Completed Date" column.

 

Is there a way to use a where as or add multiple filters so I can return everything that is not BLANK and greater than the year January 2015?

 

 

Perforamance = filter(
     Union(
     Selectcolumns('Estimates',"Category","Estimator", "Name",'Estimates'[Estimator],"Completed Date",'Estimates'[Approval_Date]), [Completed Date]<>Blank())

 

1 ACCEPTED SOLUTION

The outcome in my original formula is working and I do not receive an error message. The entire formula is about 20 lines and in my example in the original post, I only included the first string of the union, which I understand may cause confusion.

 

Over the weekend I found a solution through additional research on the web and using || for more than one conditions appears to work.  I'm not sure why && doesn't work but || does.  Thanks for looking into this.

View solution in original post

5 REPLIES 5
v-jiascu-msft
Employee
Employee

Hi @JQuon,

 

Could you please mark the proper answers as solutions?

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I'm still searching for the proper solution.  Unfortunatenly, the && doesn't work with the rest of my string in my formula.  For now, I'm only able to filter on one condition listed in my original post.

 

Thanks

Hi @JQuon,

 

Is there an error? Or the outcome isn't correct? 

If the formula is complete, the UNION isn't correct there. Please refer to the snapshot below. 

Can you share a sample if you still have issues?

Use-WHERE-condition-in-DAX-with-Union-and-Selectcolumns

 

Best Regards,
Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

The outcome in my original formula is working and I do not receive an error message. The entire formula is about 20 lines and in my example in the original post, I only included the first string of the union, which I understand may cause confusion.

 

Over the weekend I found a solution through additional research on the web and using || for more than one conditions appears to work.  I'm not sure why && doesn't work but || does.  Thanks for looking into this.

v-jiascu-msft
Employee
Employee

Hi @JQuon,

 

It seems your formula won't work. But you only need to add more conditions in the filter like below. 

 

, [Completed Date]<>Blank() && year([Completed Date]) >=2015)

If you'd like more detailed formula, please provide a sample.

 

 

 

Best Regards,
Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.