Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi All,
I have a dataset as below :
City | Total lenght in Kms |
London | 80 |
London | 80 |
Paris | 50 |
Paris | 50 |
Paris | 50 |
Paris | 50 |
I have a card display where I need to show the average of lenght when a city is selected. Which I have acheived by averaging on a selected city. However, if two cities are selected it is adding up both the cities length and averaging on it. Ex : (50+80)/2 = 65
I need to perform an average on both cities seperately and add up the averages.
Ex : 50 + 80 = 130. How do I achieve it?
Solved! Go to Solution.
usure why this is not working for me, the city and lenght are from calculated tables. I tried changing the lenght in mts to a measure, but still not working :
not quite the same. try this:
hello, try something like this:
SumAvg=
VAR single=CALCULATE(AVERAGEX(VALUES(Table1[City]),Table1[Distance]))
VAR multiple=SUMX(VALUES(Table1[City]),single)
RETURN
multiple
usure why this is not working for me, the city and lenght are from calculated tables. I tried changing the lenght in mts to a measure, but still not working :
not quite the same. try this:
This works, thanks!
no worries. it was the 'Table' vs Table that was off
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
96 | |
77 | |
63 | |
55 |
User | Count |
---|---|
143 | |
109 | |
89 | |
84 | |
66 |