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

30/60/90 Day Filter from multiple columns

I'm doing a direct query to a SQL DB to pull all the go-live dates for a group of projects and present them in table form to show the go-lives in the next 30 days, another table for 30-60 days and another table for 60-90 days. I believe I've found posts to cover that part using a summary table, the issue I'm seeing is that I need this filter to look at 15 different columns for each project for these dates as we have projects with multiple go-lives. The end result would look something like this:

 

kp_wood13_0-1679500366395.png

 

1 ACCEPTED SOLUTION
v-stephen-msft
Community Support
Community Support

Hi @kp_wood13 ,

 

Try to unpivot these date columns to get an attribute column contains headers and a value column contains dates.

Possible solutions:

1. Change the connection mode to import mode, and unpivot multiple date columns in Power Query to get one date column.

Unpivot columns - Power Query | Microsoft Learn

Power Query will always create the attribute-value pair by using two columns:

  • Attribute: The name of the column headings that were unpivoted.
  • Value: The values that were underneath each of the unpivoted column headings.

2.In the data source, SQL DB, unpivot multiple columns to get one date column.

Using PIVOT and UNPIVOT - SQL Server | Microsoft Learn

 

With single date column, you can easily filter.

 

Best Regards,

Stephen Tao

 

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

View solution in original post

1 REPLY 1
v-stephen-msft
Community Support
Community Support

Hi @kp_wood13 ,

 

Try to unpivot these date columns to get an attribute column contains headers and a value column contains dates.

Possible solutions:

1. Change the connection mode to import mode, and unpivot multiple date columns in Power Query to get one date column.

Unpivot columns - Power Query | Microsoft Learn

Power Query will always create the attribute-value pair by using two columns:

  • Attribute: The name of the column headings that were unpivoted.
  • Value: The values that were underneath each of the unpivoted column headings.

2.In the data source, SQL DB, unpivot multiple columns to get one date column.

Using PIVOT and UNPIVOT - SQL Server | Microsoft Learn

 

With single date column, you can easily filter.

 

Best Regards,

Stephen Tao

 

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.