This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
I try to write a measure which can calculate average days between orderdate and register_orderdate. In slicer two dates can be selected. For example:
In my tabular I have a seperate column for date which I use in slicer; dateKey_FK (20210401 , 20210610,...)
and in table in report:
Can you please guide me how I can write measure for 'Average_registerdate'
Solved! Go to Solution.
Hi @Anonymous ,
According to your request, I did the following test: dateKey_FK is a separate date list, and there is no relationship between the two tables. Reference is as follows:
avg_day =
VAR a =
MIN ( dateKey_FK[Date] )
VAR b =
MAX ( dateKey_FK[Date] )
VAR c =
CALCULATE (
COUNTROWS ( 'Table' ),
FILTER (
ALL ( 'Table' ),
'Table'[Orderdate] >= a
&& 'Table'[RegisterOrderdate] <= b
)
)
VAR d =
CALCULATE (
SUM ( 'Table'[day_diff] ),
FILTER (
ALL ( 'Table' ),
'Table'[Orderdate] >= a
&& 'Table'[RegisterOrderdate] <= b
)
)
RETURN
d / c
Below is the sample pbix file.
If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Nice day
in excel I track tickets to validate the aging, but at the time of replicating it in PowerBi, I can not tell you in what case the ticket is not closed tell me how many days it has been open
Generate a column that said End_Date and tells me the day we are on and I can calculate with datediff the values between the 2 dates, but I need to add what is indicated in the excel form.
I appreciate your help with the topic
Since then I must typify it like this:
=YES. ERROR(IF([@[Open Days]]="CLOSED";" Closed";IF(Y([@[Open Days]]>=0;[ @[Open Days]]<=15);" 0-15 Days";Y(Y([@[Open Days]]>15;[ @[Open Days]]<=30);" 16-30 Days";Y(Y([@[Open Days]]>30;[ @[Open Days]]<=45);" 31-45 Days";SI([@[Open Days]]>=45;" Greater than 45 Days";" Verify")))));" Review")
I have all this in excel. and I want to replicate it in PowerBi
Hi @Anonymous ,
According to your request, I did the following test: dateKey_FK is a separate date list, and there is no relationship between the two tables. Reference is as follows:
avg_day =
VAR a =
MIN ( dateKey_FK[Date] )
VAR b =
MAX ( dateKey_FK[Date] )
VAR c =
CALCULATE (
COUNTROWS ( 'Table' ),
FILTER (
ALL ( 'Table' ),
'Table'[Orderdate] >= a
&& 'Table'[RegisterOrderdate] <= b
)
)
VAR d =
CALCULATE (
SUM ( 'Table'[day_diff] ),
FILTER (
ALL ( 'Table' ),
'Table'[Orderdate] >= a
&& 'Table'[RegisterOrderdate] <= b
)
)
RETURN
d / c
Below is the sample pbix file.
If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous , This filter is on which date- orderdate or register_orderdate ?
you can get Avg as
averageX(Table, Datediff(orderdate, register_orderdate, day))
It's based on datekey_FK.
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 27 | |
| 25 | |
| 22 | |
| 20 | |
| 14 |
| User | Count |
|---|---|
| 50 | |
| 45 | |
| 20 | |
| 18 | |
| 18 |