Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin 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.
I have two tables and each of them holds the data from different years (2023 and 2024). I would like to create a measure that would calculate the average of column A from each table. so for example, if Table A is for 2023, Table B is for 2024 I can do the following:
(AVERAGE(TABLE_A[A]) + AVERAGE(TABLE_B[A])) / 2
problem with this is that sometimes users might select dates that don't spill into other tables which skews the results. Say if my calculated average for July 2023 is 12 this formula would give me a result of 6 instead of 12.
Any suggestions?
Solved! Go to Solution.
Hi @stribor45
Thanks for the reply from aduguid .
My sample:
Slicer table:
TableA:
TableB:
Create a measure as follows
Measure =
VAR _1 = CALCULATE(MAX('TableA'[A]), FILTER(TableA, [Date] = SELECTEDVALUE(Slicer[Date])))
VAR _2 = CALCULATE(MAX('TableB'[A]), FILTER(TableB, [Date] = SELECTEDVALUE(Slicer[Date])))
RETURN
IF(_1 = BLANK() || _2 = BLANK(), (_1 + _2) / 1, (_1 + _2) / 2)
Output:
Best Regards,
Yulia Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @stribor45
Thanks for the reply from aduguid .
My sample:
Slicer table:
TableA:
TableB:
Create a measure as follows
Measure =
VAR _1 = CALCULATE(MAX('TableA'[A]), FILTER(TableA, [Date] = SELECTEDVALUE(Slicer[Date])))
VAR _2 = CALCULATE(MAX('TableB'[A]), FILTER(TableB, [Date] = SELECTEDVALUE(Slicer[Date])))
RETURN
IF(_1 = BLANK() || _2 = BLANK(), (_1 + _2) / 1, (_1 + _2) / 2)
Output:
Best Regards,
Yulia Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I'd use power query and append the tables to get it into one recordset.
Yes i was hoping to use DAX
Try this measure
Combined Average =
VAR AvgA_2023 =
CALCULATE(
AVERAGE(Table_A[A]),
NOT(ISBLANK(Table_A[A]))
)
VAR AvgA_2024 =
CALCULATE(
AVERAGE(Table_B[A]),
NOT(ISBLANK(Table_B[A]))
)
VAR CountTableA =
CALCULATE(
COUNTROWS(Table_A),
NOT(ISBLANK(Table_A[A]))
)
VAR CountTableB =
CALCULATE(
COUNTROWS(Table_B),
NOT(ISBLANK(Table_B[A]))
)
VAR TotalRows = CountTableA + CountTableB
RETURN
IF(
TotalRows = 0,
BLANK(),
(IF(CountTableA > 0, AvgA_2023, 0) + IF(CountTableB > 0, AvgA_2024, 0)) /
(IF(CountTableA > 0, 1, 0) + IF(CountTableB > 0, 1, 0))
)
I am getting 0 as a result
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.