Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
PrakashPalle
Frequent Visitor

Minimum sales value against category

Hi All,

I need lowest sales value vendor name wherever null present in vendor name column. 

Please share the dax expression for the below. Screen shot for your reference.

 

PrakashPalle_0-1708340475917.png

 

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@PrakashPalle 

is this what you want?

Column = MAXX(FILTER('Table','Table'[Sales]=EARLIER('Table'[Sales])),'Table'[Vendor Name])
11.PNG




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

5 REPLIES 5
ryan_mayu
Super User
Super User

@PrakashPalle 

is this what you want?

Column = MAXX(FILTER('Table','Table'[Sales]=EARLIER('Table'[Sales])),'Table'[Vendor Name])
11.PNG




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Ashish_Mathur
Super User
Super User

Hi,

Cannot understand the input/output.  Do you need the result on a card visual?  Do you want the name and the price?  Share data in a format that can be pasted in an MS Excel file and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi @Ashish_Mathur , Thanks for the reply.

I need name & price in table format. 1st table actual data & 2nd is expected data.

Others are contributing.  They will help you.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
vicky_
Super User
Super User

Hey, 
please try the following:

Vendor Name (no nulls) = IF(
    'Table (2)'[Vendor Name] = "", CALCULATE(MIN('Table (2)'[Vendor Name]), TOPN(1, ALL('Table (2)'), 'Table (2)'[Sales], ASC)), // find vendor with lowest sales
    'Table (2)'[Vendor Name] // just use the existing vendor name
)

Note - at the moment, the DAX will return the first vendor (alphabetically) in the case that there are two or more vendors with the same lowest sales. 

I recommend you take a look at the topN function documentation: https://learn.microsoft.com/en-us/dax/topn-function-dax

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.