Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hello Experts,
I am facing issue while converting below SQL query into DAX. Can you please help me to convert the query:
SELECT
first_name AS 'Name',
last_name AS 'Surname',
IFNULL(l.logged_hours, 0.0) AS 'Logged Hours',
IFNULL(b.billable_hours, 0.0) AS 'Billable Hours',
IFNULL(nb.non_billable_hours, 0.0) AS 'Non-Billable Hours'
FROM
at_user u
LEFT JOIN
(SELECT user_id, sum(actuals) / 60 as logged_hours
FROM tt_record
GROUP BY user_id) AS l ON u.id = l.user_id
LEFT JOIN
(SELECT user_id, sum(actuals) / 60 as billable_hours
FROM
(SELECT
user_id, task_id, actuals, billing_type_id
FROM
actitimedb.tt_record r LEFT JOIN task t ON r.task_id = t.id LEFT JOIN project p ON p.id = t.project_id
WHERE
p.customer_id <> 383) ch
GROUP BY
user_id) AS b ON b.user_id = u.id
LEFT JOIN
(SELECT user_id, sum(actuals) / 60 as non_billable_hours
FROM
(SELECT
user_id, task_id, actuals, billing_type_id
FROM
actitimedb.tt_record r LEFT JOIN task t ON r.task_id = t.id LEFT JOIN project p ON p.id = t.project_id
WHERE
p.customer_id = 383) ch
GROUP BY
user_id) AS nb ON nb.user_id = u.id
WHERE
u.username NOT IN ('.....',
'.....',
'....',
'....',
'....',
'....',
'...',
'.....' )
ORDER BY Surname, Name
Hi @psilos24 ,
Please refer to this article.
https://www.sqlbi.com/articles/from-sql-to-dax-projection/
Also you can share your sample data and excepted result to me if you don't have any Confidential Information. Please upload your files to One Drive and share the link here.
Hello psilos24,
What exactly are you wanting to do here? Create a measure? A summary table? An entire table in your model? I see you're pulling in 5 fields so I'd assume you're wanting this to be a table in your model.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Ask questions in Eventhouse and KQL, Eventstream, and Reflex.
User | Count |
---|---|
85 | |
83 | |
66 | |
60 | |
56 |
User | Count |
---|---|
183 | |
111 | |
105 | |
77 | |
70 |