Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
PeterNowak
Frequent Visitor

IF (?) formula with multiple conditions

Hello,

 

I'm looking for solution how can I create measure which will help me later in filtering.

I'm live connected to transaction database with customer data etc.

I need to create measure(?) with below conditions:

 

If filtered on 'XYZ' then we should only see:

  - number of Activities done one single day and above 20.

  - Customers that have more than 200 activities per month

 

Thanks in advance,

Piotr

2 REPLIES 2
v-yangliu-msft
Community Support
Community Support

Hi  @PeterNowak ,

According to your description, I created some data to show:

v-yangliu-msft_0-1606981440295.png

Here are the steps you can follow:

1. Create calculated column.

Month = MONTH('Table (2)'[Date])

2. Create measure.

Measure =
var _1=CALCULATE(SUM('Table (2)'[amount]),FILTER(ALL('Table (2)'),'Table (2)'[Month]=MAX('Table (2)'[Month])))
return IF(_1>200 && MAX('Table (2)'[amount])>20,_1,BLANK())

3. Result.

v-yangliu-msft_1-1606981440299.png

You can downloaded PBIX file from here.

 

Best Regards,

Liu Yang

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

AllisonKennedy
Super User
Super User

@PeterNowak  Without your specific data model, I can't give specific help, but you can use 

 

&&

 

to add multiple conditions to an IF() or SWITCH() statement in DAX. https://docs.microsoft.com/en-us/dax/dax-operator-reference#logical-operators

 


Hopefully that helps point you in the right direction?


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Helpful resources

Announcements
Fabcon_Europe_Social_Bogo

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.