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.
Hello,
Sorry very new to this and trying to help migrate(recreate ssrs reports to PowerBI) - All data is pulled in from the SQL server.
I have a [Customer Name] column and a measure with the total number of orders for each customer.
The table contains two date columns - [Recieved Date] and [Effective Date]
I am looking to create a measure that simply shows the avg days between the Rec Date and Eff Date across all the customers orders and call it Avg. Lag Time.
Customer Name Total Orders Avg Lag Time
Smith & Smith 100 30
Thanks for any help. I have search the forums but am finding similiar request that are doing more than I need.
Solved! Go to Solution.
Hi @Sagimore88
please try
Avg Lag Time =
AVERAGEX (
TableName,
DATEDIFF ( TableName[Recieved Date], TableName[Effective Date], DAY )
)
Hi @Sagimore88
please try
Avg Lag Time =
AVERAGEX (
TableName,
DATEDIFF ( TableName[Recieved Date], TableName[Effective Date], DAY )
)
Thank you!
That works but seems to give me the avg lag time of all orders vs giving me the average for the values in the row.
Customer Orders Avg Lag time
Smith 12 39.4
Johnson 1 39.4
Customer and Order are in the same table the two dates i'm averaging are in a different table.
I feel like the results for avg are not taking into account the data from the other two columns.
Thanks Again, Ill keep trying
What are the relationships between thses tables? Can you share a screenshot of your data model?
Thanks that question made me look- I had to change the cross filter on the tables in modeling to 'Both' -
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 |