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
rob_mysbxsec
Helper II
Helper II

make filters an OR not and AND

Is there a way to say that i want these first to filter settings to be an OR not an AND combined with the remaining filter settings to be the typical AND setting?

 

myusrn_0-1611364778377.png

 

1 ACCEPTED SOLUTION

@MFelix thanks for the response. 

I ended up using using the following Measure and Column settings to arrive at something i could just then use report page filter that looks for is_two_years_old = TRUE.   Interested in any thoughts you might have as to weather or not this is an inefficient way to arrive at end goal.

Measure / two_years_ago = EDATE( UTCTODAY(), -24 )

Column / denormalized_completion_date = IF ('request_inner_join_ms_option_data'[review_completion_date] <> BLANK(),
    'request_inner_join_ms_option_data'[review_completion_date],
    'request_inner_join_ms_option_data'[production_launch_date]
)

Column / is_two_years_old = IF ([denormalized_completion_date] <= [two_years_ago], TRUE, FALSE)

View solution in original post

5 REPLIES 5
v-lionel-msft
Community Support
Community Support

Hi @rob_mysbxsec ,

 

Please refer to the blog.

Using OR conditions between slicers in DAX 

 

Best regards,
Lionel Chen

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

 

@v-lionel-msft Interesting thanks for the response and link to details on how to link slicer settings to OR'd vs AND'd calculated Column data. 

MFelix
Super User
Super User

Hi @rob_mysbxsec ,

 

You cannot change the logic behind the filter pane, however depending on how you want to se the filter pane this can be overcome wiht a measure.

 

The only question is about the way people are using the filter pane, do you want people to change the dates in the two fields above or should they keep has you have?

 

If you create a measure similar to the one below you can then use it on your visualization instead of the current value you already have:

Measure filtered =
CALCULATE (
    SUM ( Table[Column] ),
    FILTER (
        Table,
         (
            Table[DateColumn] >= DATE ( 2013, 11, 1 )
                || ISBLANK ( Table[DateColumn] )
        )
            || (
                Table[DateColum2] >= DATE ( 2013, 11, 1 )
                    || ISBLANK ( Table[DateColumn2] )
            )
    )
)

 

You can replace the SUM(Table[Column]) by other columns or syntax or even a measure.

 

 

 


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



@MFelix thanks for the response. 

I ended up using using the following Measure and Column settings to arrive at something i could just then use report page filter that looks for is_two_years_old = TRUE.   Interested in any thoughts you might have as to weather or not this is an inefficient way to arrive at end goal.

Measure / two_years_ago = EDATE( UTCTODAY(), -24 )

Column / denormalized_completion_date = IF ('request_inner_join_ms_option_data'[review_completion_date] <> BLANK(),
    'request_inner_join_ms_option_data'[review_completion_date],
    'request_inner_join_ms_option_data'[production_launch_date]
)

Column / is_two_years_old = IF ([denormalized_completion_date] <= [two_years_ago], TRUE, FALSE)

Hi @rob_mysbxsec ,

 

Believe this is one of the alternatives, the question about the effeciency, I believe comes from the way you use your report and the amount of data, if your report needs to be dinamic maybe this should be used with slicers, if it's a static value belive this is a good way.

 

Don't forget to accept your own answer so it can help others.


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



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.