Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi All,
Please see below data.
The column "Hire (Days)" is a calculated column created by the below DAX.
Hire Duration = DATEDIFF('Standing Scaffold Data'[On Hire Date],'Standing Scaffold Data'[Off Hire Date],DAY)
I require the calculated column to show me the hire for all items but at the moment it is not showing me the "Hire (Days)" for items still on hire. The items that are not yet off-hire will need to show a "Hire (Days)" to the current day.
Is there any way I can use DAX to show me the Hire Days for all items?
Solved! Go to Solution.
Hire Duration = DATEDIFF('Standing Scaffold Data'[On Hire Date],
IF(ISBLANK('Standing Scaffold Data'[Off Hire Date]),TODAY(),'Standing Scaffold Data'[Off Hire Date]),DAY)
Try this.
Proud to be a Super User!
Hi @Anonymous ,
You can try modifying your DAX as follows:
Hire Duration = IF('Standing Scaffold Data'[Off Hire Date] = BLANK(),
DATEDIFF('Standing Scaffold Data'[On Hire Date], TODAY(), DAY),
DATEDIFF('Standing Scaffold Data'[On Hire Date], 'Standing Scaffold Data'[Off Hire Date], DAY)
)
Thanks,
Pragati
@Anonymous - Perhaps:
Hire Duration =
VAR __Diff1 = DATEDIFF('Standing Scaffold Data'[On Hire Date],'Standing Scaffold Data'[Off Hire Date],DAY)
VAR __Diff2 = DATEDIFF('Standing Scaffold Data'[On Hire Date],TODAY(),DAY)
RETURN
IF(ISBLANK(__Diff1),__Diff2,__Diff1)
Hire Duration = DATEDIFF('Standing Scaffold Data'[On Hire Date],
IF(ISBLANK('Standing Scaffold Data'[Off Hire Date]),TODAY(),'Standing Scaffold Data'[Off Hire Date]),DAY)
Try this.
Proud to be a Super User!
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 48 | |
| 45 | |
| 41 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 69 | |
| 63 | |
| 32 | |
| 31 | |
| 25 |