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!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
I am trying to calculate an average based on number of transactions and #days to complete.
The dataset looks like
TX_CNT DAYS_TO_COMPLETE
5 13
2 5
1 3
So the average days to complete by transaction is 9.75 = ((13*5)+(5*2)+(3x1)) / (5+2+1)
I have this data in one table coming from SQL.
How can I calculate the average across rows while considering the TX_CNT.
FYI I have other attributes in the table which I'll use for legend, slicers etc... but I am trying to create a measure I can use.
Thank you!
Solved! Go to Solution.
Hi @ChristianR
If your table contains the two columns shown, you can write a measure like this to perform the weighted-average calculation:
Average days =
DIVIDE (
SUMX (
YourTable,
YourTable[TX_CNT] * YourTable[DAYS_TO_COMPLETE]
),
SUM ( YourTable[TX_CNT] )
)
Does that work for you?
Regards,
Owen
Hello @ChristianR ,
Create a below two measures
Hi @ChristianR
If your table contains the two columns shown, you can write a measure like this to perform the weighted-average calculation:
Average days =
DIVIDE (
SUMX (
YourTable,
YourTable[TX_CNT] * YourTable[DAYS_TO_COMPLETE]
),
SUM ( YourTable[TX_CNT] )
)
Does that work for you?
Regards,
Owen
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 63 | |
| 52 | |
| 41 | |
| 23 | |
| 18 |
| User | Count |
|---|---|
| 124 | |
| 108 | |
| 47 | |
| 28 | |
| 27 |