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
For every hour I want to subtract one column from the other one only if the last column is smaller than the first one. Then I want the average of the result.
Currently trying (but failing obviously) like:
Solved! Go to Solution.
Hi @fisqkuz
Try this way, create the measures
DIFF = IF(MIN('Table'[Y])<MIN('Table'[X]),MIN('Table'[X])-MIN('Table'[Y]))average = AVERAGEX('Table',[DIFF])
result (see sample file attached below)
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
Hi @fisqkuz
Try this way, create the measures
DIFF = IF(MIN('Table'[Y])<MIN('Table'[X]),MIN('Table'[X])-MIN('Table'[Y]))average = AVERAGEX('Table',[DIFF])
result (see sample file attached below)
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
@fisqkuz , force a row context/gorup by , prefer visual group/axis/row
example time here
Avg Spd Column1 =
VAR bigger = CALCULATE(SUMX(table1, table1[X] - table1[Y]))
VAR two = CALCULATE(SUMX(filter(values(table1[Time]),bigger > 0), bigger)
RETURN
two
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 9 | |
| 5 | |
| 5 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 24 | |
| 11 | |
| 9 | |
| 6 | |
| 6 |