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
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]
)
Try my new Power BI game Cross the River

View solution in original post

Highlighted
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
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]
)
Try my new Power BI game Cross the River

View solution in original post

Highlighted
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
Ask Amanda Anything Q&A

Ask Amanda Anything Q&A

Learn the answers to some of the questions asked during the Amanda Triple A event.

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 Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

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: 201 members 2,314 guests
Please welcome our newest community members: