Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Good day
I would like to calculate as a column or as a measure, the days duration between the DateAdded column in an existing table and date chosen eg respective month end dates via a slicer.
The problem is that I can't calculate how many days outstanding a library book is when it has not been returned. Currently the year 3000 is being used until there is a return date.
Please help!
Solved! Go to Solution.
@Anonymous , Try like
measure =
var _max = maxx(allselected('Date'), 'Date'[Date])
return
CALCUALTE(datediff(max(Table[DateAdded]),_max, day), filter(Table, year(table[DateAdded])<3000 ))
You have to force a row context for the correct average
to refer use values or summarize:https://community.powerbi.com/t5/Community-Blog/Decoding-Direct-Query-in-Power-BI-Part-2-Date-Difference-Across/ba-p/934397#M451
@Anonymous , Try like
measure =
var _max = maxx(allselected('Date'), 'Date'[Date])
return
CALCUALTE(datediff(max(Table[DateAdded]),_max, day), filter(Table, year(table[DateAdded])<3000 ))
You have to force a row context for the correct average
to refer use values or summarize:https://community.powerbi.com/t5/Community-Blog/Decoding-Direct-Query-in-Power-BI-Part-2-Date-Difference-Across/ba-p/934397#M451
Hi @amitchandak Amit,
thank you for the response. It worked thank you.
I need to take it a step further, if the claim has been finalised before the selected date ("fulldate" above), then I need it to calculate those days in stead of from dateadd to selected date.
Also, how would I create an additional measure whereby I calculate the average duration for say a range of products rather than specific claims?
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
96 | |
77 | |
63 | |
55 |
User | Count |
---|---|
143 | |
109 | |
89 | |
84 | |
66 |