- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

new column based on specific criteria on other columns
Hi,
I need some help with a Dax code.
In table B, I want to add two new columns to be populated as the below criteria. (Time sheet Status/Overtime Status)
In table A: We have the below Info:
Organisation | Overtime Preferred |
A | No |
B | Yes |
C | Yes |
Organisation | Expenditure Type | Employee or Supplier | Quantity | Week Ending Date | Time Sheet Status(New) | Overtime Status (New) |
A | Overtime Paid | John | 10 | 20/11/2020 | To be adjusted | To be adjusted |
A | Regular Work | John | 5 | 20/11/2020 | To be adjusted | - |
B | Regular Work | John | 5 | 20/11/2020 | To be adjusted | - |
B | Regular Work | John | 15 | 20/11/2020 | To be adjusted | - |
C | Regular Work | John | 15 | 20/11/2020 | To be adjusted | - |
A | Regular Work | John | 10 | 27/11/2020 | Approved | Approved |
B | Overtime Paid | John | 5 | 27/11/2020 | Approved | - |
B | Regular Work | John | 5 | 27/11/2020 | Approved | - |
B | Regular Work | John | 10 | 27/11/2020 | Approved | - |
C | Regular Work | John | 15 | 27/11/2020 | Approved | - |
A | Overtime Paid | John | 5 | 4/12/2020 | Approved | Approved |
A | Regular Work | John | 40 | 4/12/2020 | Approved | - |
B | Overtime Paid | John | 5 | 11/12/2020 | Approved | Approved |
A | Regular Work | John | 40 | 11/12/2020 | Approved | - |
B | Overtime Paid | John | 0 | 18/12/2020 | Approved | Approved |
A | Regular Work | John | 40 | 18/12/2020 | Approved | - |
A | Regular Work | John | 10 | 25/12/2020 | To be adjusted | - |
A | Overtime Paid | John | 5 | 25/12/2020 | To be adjusted | To be adjusted |
B | Overtime Paid | John | 5 | 25/12/2020 | To be adjusted | Approved |
B | Regular Work | John | 5 | 25/12/2020 | To be adjusted | - |
B | Regular Work | John | 10 | 25/12/2020 | To be adjusted | - |
C | Regular Work | John | 15 | 25/12/2020 | To be adjusted | - |
On each employee (John) and on each weekending,
If sum of quantity for Overtime Paid = 0 (example, weekending 18/12/2020)
then time sheet status “Approved, Overtime status “-“;
(If sum of quantity for Overtime Paid > 0 then,
- If Overtime preferred for Organization is “Yes”’ in table A then overtime status “Approved” (27/11/2020,11/12/2020)
- If Overtime preferred for Organization is “No”’ in table A then
- If only one organization has quantity >0, then overtime status “Approved (4/12/2020)
- If more than one organization has quantity >0, then
- If sum of regular work for Preferred overtime organization >0, then Overtime status, “to be adjusted, else ‘Approved” (20/11/2020,25/12/2020)
If All items in Overtime status is approved or “-“, then time sheet status to be “Approved”, else “To be adjusted”
In summary, we want to make checkemployees are timewriting in the first place against the organizations which “Overtime Preferred” is yes.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

@amirghaderi Fun little puzzle. I have created two new columns in your table:
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

@amirghaderi Fun little puzzle. I have created two new columns in your table:
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Thank you very much! It worked😊

Helpful resources
Join us at the Microsoft Fabric Community Conference
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Power BI Monthly Update - February 2025
Check out the February 2025 Power BI update to learn about new features.

Subject | Author | Posted | |
---|---|---|---|
08-05-2024 11:21 AM | |||
12-08-2023 03:12 PM | |||
03-14-2024 04:55 AM | |||
05-28-2024 02:54 PM | |||
07-30-2024 11:51 AM |
User | Count |
---|---|
83 | |
79 | |
53 | |
39 | |
37 |
User | Count |
---|---|
104 | |
85 | |
47 | |
43 | |
42 |