cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

Condition column

Dear All,  I have a column where i have a list of countries,  another column for date and then the values etc.  But for some countries i do not want to show the data after certain month and date.  for example

 

before 2019  all country data to be shown,   total countries  = 70

after June 2019 show all data except one country , now new total countries  = 69

and again after  Dec 2019 do not show one more country , now the final country list = 68

how do i do this, tried conditional column but it only allows me one condition.  i need to specify, if month year >= 2019 then show all country, and if month year june 2019 >= june then show all but one, etc.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User II
Super User II

Re: Condition column

Hi there two ways to ask for more than 1 condition in DAX. You can try both:

First

 

IF(
    AND ( Condition1, Condition2 ),
    TRUE(),
    FALSE()
)

 

Second

 

IF(
    Condition1 && Condition2,
    TRUE(),
    FALSE()
)

 

 Hope this Helps,

Regards,



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

Happy to help!

LaDataWeb Blog


View solution in original post

3 REPLIES 3
Highlighted
Super User II
Super User II

Re: Condition column

Hi there two ways to ask for more than 1 condition in DAX. You can try both:

First

 

IF(
    AND ( Condition1, Condition2 ),
    TRUE(),
    FALSE()
)

 

Second

 

IF(
    Condition1 && Condition2,
    TRUE(),
    FALSE()
)

 

 Hope this Helps,

Regards,



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

Happy to help!

LaDataWeb Blog


View solution in original post

Highlighted
Super User IV
Super User IV

Re: Condition column

Here's one way you can restrict measures to certain dates for each individual country without too much work.

 

Best

D



Have I answered your question?
Please mark my post as the solution.


Please don't forget your Kudos if you don't mind. Thanks.


Highlighted
Super User IV
Super User IV

Re: Condition column

@ibarrau, wanted to bring your attention to the fact that:

IF(
    AND ( Condition1, Condition2 ),
    TRUE(),
    FALSE()
)

is exactly the same as

AND ( Condition1, Condition2 )

The second IF is exactly the same.

 

Therefore there's no point doing what you've suggested. Worse, it's more obscure and harder to understand at a glance than the plain and simple expression on its own.

 

Best

D



Have I answered your question?
Please mark my post as the solution.


Please don't forget your Kudos if you don't mind. Thanks.


Helpful resources

Announcements
Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Galleries

Galleries

Looking for inspiration on how to present your data? Need instructional videos? Check out our Galleries!

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors