Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
I have following to date column in report, Completed Date is a measure and the started date is the earliest started date from table.
Now I want to subtract them in a way that if completed is blank then now()-started date else completed - started date.
The problem is when I display days worked measure my all table data gets disappeared, and I am not sure why.
Following is my DAX Command for Measure Days Worked :
Please let me know how can I resolve this issue. Thanks
Solved! Go to Solution.
@Anonymous , Try like
Days Worked =
var _1 = IF(ISBLANK([Measure]),BLANK(),DATEDIFF(MIN(SampleData[Started Date]),[Measure],DAY))
return
if(isblank(_1) , DATEDIFF(MIN(SampleData[Started Date]),now(),DAY),_1)
@Anonymous , Try like
Days Worked =
var _1 = IF(ISBLANK([Measure]),BLANK(),DATEDIFF(MIN(SampleData[Started Date]),[Measure],DAY))
return
if(isblank(_1) , DATEDIFF(MIN(SampleData[Started Date]),now(),DAY),_1)
@Anonymous , if they are from same tbale you can create a new column
new column = datediff(coalesce([Job Completion Date], now()),[Started Date],day)
if you need a measure of they are from different table, You need a common context like job id, then you can create a meausre
New measure = sumx(values(JOB[JOB ID]),datediff(coalesce(max([Job Completion Date]), now()),min([Started Date]),day))
New measure = AverageX(values(JOB[JOB ID]),datediff(coalesce(max([Job Completion Date]), now()),min([Started Date]),day))
Hi,
The measure you provided didn't work for me.
However I have wrote the below DAX in measure and it is working:
Now the olny problem is where I have BLANK(), I want to replace that with now - SampleData[Started Date] but when I do that the data again gets disappeared and wrong values displays in Days Worked Column.
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
23 | |
7 | |
7 | |
6 | |
6 |
User | Count |
---|---|
27 | |
12 | |
10 | |
9 | |
6 |