Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Dear wrinkle brains
I have the following dim table:
Supplier:
Supplier_ID | Supplier_Name |
s1 | example_1 |
s2 | example_2 |
and the following two fact tables:
Purchase:
Purchase_ID | Order_Date | Purchase_Supplier |
p1 | 18.3.2023 | s1 |
p2 | 19.3.2023 | s2 |
p3 | 20.3.2023 | s1 |
Supply:
Purchase_ID | Supply_Date |
p1 | 24.3.2023 |
p2 | 27.3.2023 |
p3 | 28.3.2023 |
I added the following measure to my measure table:
TimeDiff = DATEDIFF(max('Purchase'[Order_Date]),max(Supply[Supply_Date]),DAY)
Now i want to show the average of the TimeDiff for every supplier (and filter the visual based on the supplier).
Every hint or example very appreciated!
Cheers!
Solved! Go to Solution.
Hi, @Rudd_ThreeTrees
You can try the following methods.
Measure:
Average =
Var _table = SUMMARIZE(Purchase,Purchase[Purchase_ID],Purchase[Purchase_Supplier],"Timediff",[TimeDiff])
Return
AVERAGEX(FILTER(_table,[Purchase_Supplier]=MAX(Supplier[Supplier_ID])),[Timediff])
Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Rudd_ThreeTrees
You can try the following methods.
Measure:
Average =
Var _table = SUMMARIZE(Purchase,Purchase[Purchase_ID],Purchase[Purchase_Supplier],"Timediff",[TimeDiff])
Return
AVERAGEX(FILTER(_table,[Purchase_Supplier]=MAX(Supplier[Supplier_ID])),[Timediff])
Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
User | Count |
---|---|
98 | |
75 | |
69 | |
49 | |
26 |