cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Wasfiathhar
Frequent Visitor

Would like to filter with multiple condition

I’m having customer aging report as sample attached.

The customer to be hold with following condition

  • Any customer invoices open more than 30days to be hold
  • And with “Dr” value also be hold

So in this scenario I’m getting filter in tradition excel

=IF(AND((TODAY()-C2>30),D2>0),"Hold","")

Wasfiathhar_0-1649718272852.png

 

But how I can hold the customer invoices less than 30days where he has old invoices outstanding

 

In this scenario, the customer “COASTLINE INC” all the line items should be hold based on first and second condition

 

Kindly advice how I can performed the filter with multiple condition in DAX

 

https://drive.google.com/file/d/1zLbXlELTeIb6yX_mADSjxfDgvFHSnNW6/view?usp=sharing

 

1 ACCEPTED SOLUTION
v-yangliu-msft
Community Support
Community Support

Hi  @Wasfiathhar ,

I created some data:

vyangliumsft_0-1649906185184.png

Here are the steps you can follow:

1. Create calculated column.

datediff = DATEDIFF('Table'[Transaction Date],TODAY(),DAY)

2. Create measure.

Flag =
var _max=CALCULATE(MAX('Table'[datediff]),FILTER(ALL('Table'),'Table'[Customer Name]=MAX('Table'[Customer Name])&&'Table'[Dr/Cr]=MAX('Table'[Dr/Cr])))
return
IF(
    _max >=30 && MAX('Table'[USD]) >0,1,0)

3. Place [Flag]in Filters, set is=1, apply filter.

vyangliumsft_1-1649906185185.png

4. Result:

vyangliumsft_2-1649906185187.png

Please click here for the pbix file

 

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

View solution in original post

3 REPLIES 3
v-yangliu-msft
Community Support
Community Support

Hi  @Wasfiathhar ,

I created some data:

vyangliumsft_0-1649906185184.png

Here are the steps you can follow:

1. Create calculated column.

datediff = DATEDIFF('Table'[Transaction Date],TODAY(),DAY)

2. Create measure.

Flag =
var _max=CALCULATE(MAX('Table'[datediff]),FILTER(ALL('Table'),'Table'[Customer Name]=MAX('Table'[Customer Name])&&'Table'[Dr/Cr]=MAX('Table'[Dr/Cr])))
return
IF(
    _max >=30 && MAX('Table'[USD]) >0,1,0)

3. Place [Flag]in Filters, set is=1, apply filter.

vyangliumsft_1-1649906185185.png

4. Result:

vyangliumsft_2-1649906185187.png

Please click here for the pbix file

 

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

Wasfiathhar
Frequent Visitor

If any customer having overdue invoices (30+) need to hold the customers all the line items including the current invoices. 
How Dax can be perform 

lance_6
Helper II
Helper II

I don't 100% understand what you're wanting. However, I beilieve this may be helpful for you: https://www.youtube.com/watch?v=jyxZxFT_pAY

Helpful resources

Announcements
August 1 episode 9_no_dates 768x460.jpg

The Power BI Community Show

Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.

Power BI Dev Camp Session 24 without aka link and time 768x460.jpg

Ted's Dev Camp - July 28, 2022

Watch Session 24 of Ted's Dev Camp along with past sessions!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Top Solution Authors
Top Kudoed Authors