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,
I am using the below DAX expression
City with Highest Sales but lowest profit = LOOKUPVALUE('Orders'[City],
'Orders'[Profit],
Min('Orders'[Profit]),
'Orders'[Sales],
Max('Orders'[Sales])
)
but did not get anything. Please correct me if I am wrong here.
Solved! Go to Solution.
@Anonymous
You can use this MEASURE
Measure = MINX ( TOPN ( 1, FILTER ( Orders, Orders[Country] = "India" ), [Profit], ASC ), [City] )
Hi @Anonymous
I believe Your formula will only fetch a city when a particular city has both Maximum Sales and Minimum Profit out of all Citiies
Otherwise it will return BLANK
So if your data looks like this...your result would be City E
City | Sales | Profit |
A | 8519 | 35 |
B | 8915 | 75 |
C | 9327 | 42 |
D | 1483 | 11 |
E | 9000 | 1 |
But with following table the result would be blank as the City with highest sales doesnot have minimum profit
City | Sales | Profit |
A | 8519 | 35 |
B | 8915 | 75 |
C | 9327 | 42 |
D | 1483 | 11 |
E | 9000 | 12 |
HI,
So if I want in India what is city name having lowest profit? and have used below query:
City with lowest profit in India = LOOKUPVALUE('Orders'[City],
'Orders'[Profit],
Min('Orders'[Profit]),
'Orders'[Country],'India'
)
but I am getting error that table name of 'India' cannot found.
@Anonymous
You can use this MEASURE
Measure = MINX ( TOPN ( 1, FILTER ( Orders, Orders[Country] = "India" ), [Profit], ASC ), [City] )
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 |
---|---|
111 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
93 | |
84 | |
66 |