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
Anonymous
Not applicable

How to setup filters in power bi if the filters have some commen set of values

I have a date coloumn in excel with different values, I want to create a filter based on the date values on the following way.

 

Filter 1: Show date with values from 1 to 13

Filter2:  Show date with values from 10 to 20

 

Here Filter1 & Filter2  have a  common subset( values 10-13)

 

Pls help..

 

Filter2Issue.PNG

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I've succcessfully implement this logic by creating a new Filter  table using the following DAX , and added the relationship as many to many between the source data table and FilterTable.

Thanks @Surya

 

FilterTable=

VAR TabA_ =

    ADDCOLUMNS ( GENERATESERIES ( 1, 13 ), "filter", Filter1" )

VAR TabB_ =

    ADDCOLUMNS ( GENERATESERIES ( 10, 20 ), "filter", "Filter2" )

RETURN

    UNION ( TabA_, TabB_ )

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

I've succcessfully implement this logic by creating a new Filter  table using the following DAX , and added the relationship as many to many between the source data table and FilterTable.

Thanks @Surya

 

FilterTable=

VAR TabA_ =

    ADDCOLUMNS ( GENERATESERIES ( 1, 13 ), "filter", Filter1" )

VAR TabB_ =

    ADDCOLUMNS ( GENERATESERIES ( 10, 20 ), "filter", "Filter2" )

RETURN

    UNION ( TabA_, TabB_ )

v-xicai
Community Support
Community Support

Hi @Anonymous ,

 

You can create two calculated tables like DAX below.

 

Filter1 = CALCULATETABLE(DISTINCT('Table'[Date]),FILTER('Table','Table'[Val]>=1&&'Table'[Val]<=13))
 
Filter2 = CALCULATETABLE(DISTINCT('Table'[Date]),FILTER('Table','Table'[Val]>=10&&'Table'[Val]<=20))

Then create relationships between the three tables. Finally, you can put the Date fields of the Filter1 and Filter2 into two Slicer visuals separately.

 

23.png

 

 

 

 

Best Regards,

Amy

 

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

 

 

Anonymous
Not applicable

you could create bins/groups with date parameters, that way you can name them too. 

Anonymous
Not applicable

Please help

tex628
Community Champion
Community Champion

Create 2 calendar tables. 

 

Create relationships between these 2 tables and your existing table. 

The 2 relationships need to be one -> many / single crossfilter direction.

Create 2 relative date slicers, one for each calendar table. 

Hope it works!


Connect on LinkedIn

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.