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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi all,
I have two tables, ones containing measured values by some sensorsand one containing estimated values for those locations. Both tables contain results for a 24hours duration. Each table have the following relevant columns:
- Sensor ID
- Hour
- Value measured/calculated
- Auxiliar ID which concatenate the sensor ID with the hour , which allows to stablish a relationship between the two tables to compare results for each timestep
For each sensor, I wanted a table that showed the maximum difference between calculated and measured values so I can see in which sensors my predicted values are off. I used the following DAX:
Many thanks,
Solved! Go to Solution.
@Anonymous
try smth like
CALCULATE(
MAXX(Merge1,abs(Merge1[Measured value] - ModelResults[Calculated Value])),
ALLEXCEPT(Merge1, Merge1[Sensor ID])
)
While it would be better to append your table (with predicted/measured with same column name), and pivot that column out to get predicted and measured on same rows, please try this approach as a Measure instead of a calculated column.
Max Difference = MAXX(MeasuredTable, MeasuredTable[MeasuredValue] - RELATED(PredictedTable[PredictedValue]))
This assumes there is a 1:1 relationship (or Many:1) between the Measured and Predicted tables. Use the measure in a table visual with your SensorID column from the MeasuredTable. You could also use the measure in a line chart to visualize the different at each hour.
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Thanks Mahoneypat, but it seems the related function does not accept any column from my related table
@Anonymous
try smth like
CALCULATE(
MAXX(Merge1,abs(Merge1[Measured value] - ModelResults[Calculated Value])),
ALLEXCEPT(Merge1, Merge1[Sensor ID])
)
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!