Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
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] )
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
87 | |
87 | |
86 | |
67 | |
49 |
User | Count |
---|---|
134 | |
113 | |
100 | |
68 | |
67 |