cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dsandip59 Member
Member

city name in india which have lowest profit

Hi,

I need city names in india which have lowest profit and using the below query:

 

City with lowest profit in India  = calculate(LOOKUPVALUE('Orders'[City],
                         'Orders'[Profit],
                         Min('Orders'[Profit])
                         )
),  'Orders'[Country]=  'India')

 

and it says that "Column 'Country="India"' in table 'Orders' cannot be found or may not be used in this expression."

 

Please correct the DAX expression

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Super User
Super User

Re: city name in india which have lowest profit

@dsandip59

 

Try this MEASURE

 

Measure =
MINX (
    TOPN ( 1, FILTER ( Orders, Orders[Country] = "India" ), [Profit], ASC ),
    [City]
)

View solution in original post

dsandip59 Member
Member

Re: city name in india which have lowest profit

HI,

I have used the below query:

 

City with lowest profit in India = calculate(LOOKUPVALUE('Orders'[City],
                         'Orders'[Profit],
                         Min('Orders'[Profit])
                         )
, FILTER(Orders, Orders[Country]=  "India")
)

 

and it also works fine for me.

View solution in original post

3 REPLIES 3
Highlighted
Super User
Super User

Re: city name in india which have lowest profit

@dsandip59

 

Try this MEASURE

 

Measure =
MINX (
    TOPN ( 1, FILTER ( Orders, Orders[Country] = "India" ), [Profit], ASC ),
    [City]
)

View solution in original post

dsandip59 Member
Member

Re: city name in india which have lowest profit

HI,

I have used the below query:

 

City with lowest profit in India = calculate(LOOKUPVALUE('Orders'[City],
                         'Orders'[Profit],
                         Min('Orders'[Profit])
                         )
, FILTER(Orders, Orders[Country]=  "India")
)

 

and it also works fine for me.

View solution in original post

dsandip59 Member
Member

Re: city name in india which have lowest profit

Hi,

 

Thanks for your reply and it is very helpful to me.

 

Thanks,

Sandip

Helpful resources

Announcements
October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Badges

Incoming: New and Improved Badges

Exciting news: We've given our badges an overhaul and added brand news ones.

Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 355 members 3,197 guests
Please welcome our newest community members: