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.
Hello,
I have 2 tables :
A table that gives the average cost per country
another one that gives the total cost per country
I would like to create a visual that lists only the countries where Total Cost > Average Cost i.e:
FRANCE and USA
What is the best way to do that for a very large table?
Thank you
Gerard
Solved! Go to Solution.
@abalgir ,
Try something like this - sumx(filter(summarize(Country[Country], "_Avg",[Avg Cost],"_sum",[Total Cost]), [_sum]>[_avg]),[_sum])
You can replace [_sum] with [_avg]
Hi @abalgir ,
We can try to create a measure, then put it into visual filter and set condition as "is 1" to meet your requirement:
Visual Control =
IF ( [TOTAL COST] > [AVG COST], 1, -1 )
If it doesn't meet your requirement, kindly share your sample data and expected result to me if you don't have any Confidential Information. Please upload your files to One Drive For Business and share the link here.
Best regards,
@abalgir ,
Try something like this - sumx(filter(summarize(Country[Country], "_Avg",[Avg Cost],"_sum",[Total Cost]), [_sum]>[_avg]),[_sum])
You can replace [_sum] with [_avg]
hI @abalgir ,
Are those tables two separate tables in your data model or are they from the same table but shown in separate visuals?
The formula below works if the data is coming from the same table.
Country measure =
SUMX (
VALUES ( 'Table'[Country] ),
VAR __TOTAL =
CALCULATE (
SUM ( 'Table'[Total Cost] ),
ALLEXCEPT ( 'Table', 'Table'[Country] )
)
VAR __AVERAGE =
CALCULATE (
AVERAGE ( 'Table'[Total Cost] ),
ALLEXCEPT ( 'Table', 'Table'[Country] )
)
RETURN
IF ( __TOTAL > __AVERAGE, __TOTAL )
)
Proud to be a Super User!
Hi,
Thank you for the response, these are 2 separate tables
I tried on the same table and both methods work.
Thank you
I tested on the same table and both methods work.
Thanks
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 | |
95 | |
76 | |
65 | |
51 |
User | Count |
---|---|
146 | |
109 | |
106 | |
88 | |
61 |