cancel
Showing results for 
Search instead for 
Did you mean: 
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 III
Super User III

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)

View solution in original post

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
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

April Update

Check it Out!

Click here to read more about the April 2021 Updates!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

secondImage

Experience what’s next for Power BI

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