Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
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 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.
@amirghaderi Fun little puzzle. I have created two new columns in your table:
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
@amirghaderi Fun little puzzle. I have created two new columns in your table:
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
Thank you very much! It worked😊
User | Count |
---|---|
116 | |
73 | |
60 | |
48 | |
48 |
User | Count |
---|---|
171 | |
122 | |
60 | |
59 | |
56 |