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!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
I have a table with average of new patients for each account, now I need a average of new patients in state level, so for accounts in one state should average by state to be same. This is get a baseline to compare each account. Please find the table below.
I want the DAX for the last Average Newpatient by state column, currently I have brought it by SQL querying, but going forward I would need a dax to do this.
Something I tried but isn't showing right numbers:
Hi @Anonymous ,
Depending on the information you provided, please follow this step below:
1.Add new measure.
StateLevelAverageNewPatientsPerLocation =
VAR TotalNewPatientsInState =
CALCULATE (
SUM ( 'NewPatient'[NewPatientsCount] ),
ALLEXCEPT ( 'NewPatient', 'NewPatient'[Buckets] )
)
VAR TotalLocationsInState =
CALCULATE (
SUM ( 'NewPatient'[LocationKey] ),
ALLEXCEPT ( 'NewPatient', 'NewPatient'[Buckets] )
)
RETURN
DIVIDE ( TotalNewPatientsInState, TotalLocationsInState, BLANK () )
Final output:
How to Get Your Question Answered Quickly - Microsoft Fabric Community
If it does not help, please provide more details with your desired out put and pbix file without privacy information.
Best Regards,
Ada Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks for the reply, but [bucket] and [state] columns are both in another table called 'Account ids', and 'New patient' table is joined by [Account id] field. Please find the pbix file here: SALESCopy.pbix.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!