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!Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.
i have table that have
Patient ID invoice no. Doctor Service No. Amount Episode No. ( visit No)
001 22-01 10 654 50 01
001 22-01 10 859 100 01
002 22-02 09 357 75 01
002 22-02 09 658 650 01
Episode No. serial from 1 for each patient
how can i calculate average amount by Episode for each patient ?
Solved! Go to Solution.
Hi @hanygameel
try to create a measure with this:
In case of failure, please provide more data to cover the complexity of your case.
Thanks for your quick response
it gives me the total amount
Hi @hanygameel
it depends of which column are you slicing by in your visual. If you are slicing by Patient ID then AVERAGE ( 'Table'[Amount] ) will do. Unless you need to sum the averages at the grand total level the you can use
SIMX ( VALUES ( 'Table'[Patient ID] ), CALCULATE ( AVERAGE ( 'Table'[Amount] ) ) )
I need to calculate the average episode amount for the doctor
in other way, I need the average amount paid by the patient in the episode ( doctor visit )
Please try
Average Amount =
AVERAGEX (
FILTER (
SUMMARIZE (
'Table',
'Table'[Patient ID],
'Table'[Episode No.],
"@Amount", SUM ( 'Table'[Amount] )
),
[@Amount] > 0
),
[@Amount]
)
i can not understand this
Thank you Very Much
i got it
Hi @hanygameel
try to create a measure with this:
In case of failure, please provide more data to cover the complexity of your case.
Also, i need to exclude zero amount from the average calculation
User | Count |
---|---|
11 | |
9 | |
6 | |
5 | |
4 |