Help with DAX IF AND expression OR a COUNTIF Measure

willow1985

Well-known Member
Joined
Jul 24, 2019
Messages
725
Office Version
  1. 365
Platform
  1. Windows
I am new to power BI so I am trying to figure out the best way to achieve the following:

What I would like is a measure (a count) of which items are late being Quoted.

I have 2 date columns; Date Received and Date Quoted.


1st idea:

I created a column with the following DAX expression:

Code:
LATE/ON TIME = IF(AND('winnipeg erp_workorder'[Date Received]<(TODAY()-5),ISBLANK('winnipeg erp_workorder'[Date Quoted]),"LATE","ON TIME")))

that I was hoping would flag which items were late and which were on time, but it was clearly written incorrectly.

What I wanted was:

If the date received was greater than 5 days prior to todays date AND Date Quoted is blank, mark as "LATE", otherwise it is "ON TIME".

I then want to create a measure that counts anything that is listed as "LATE".

2nd idea:

Perhaps the count could be done without creating the extra column and do a measure that counts the row If the date received was greater than 5 days prior to todays date AND Date Quoted is blank.

I hope someone can help me, still trying to learn DAX.

Thank you
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop

willow1985

Well-known Member
Joined
Jul 24, 2019
Messages
725
Office Version
  1. 365
Platform
  1. Windows
Answer:

LATE/ON TIME =IF (AND ('winnipeg erp_workorder'[Date Received]< ( TODAY () - 5 ),ISBLANK ( 'winnipeg erp_workorder'[Date Quoted] )),"LATE","ON TIME)
 
Solution

Watch MrExcel Video

Forum statistics

Threads
1,133,271
Messages
5,657,760
Members
418,411
Latest member
Excellency

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top