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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
cdawidow
Helper III
Helper III

How to find quantity sold at specific unit price level?

Hey guys, just wondering what dax synthax would be the best to find the quantity sold per product when unit net price = max(unit price)

1 ACCEPTED SOLUTION
AntrikshSharma
Super User
Super User

Try this:

=
VAR MaxUnitPrice =
    MAX ( Table[UnitPrice] )
VAR Result =
    SUMX (
        VALUES ( Table[ProductName] ),
        CALCULATE ( SUM ( Table[Quantity] ), Table[UnitPrice] = MaxUnitPrice )
    )
RETURN
    Result

 

View solution in original post

3 REPLIES 3
AntrikshSharma
Super User
Super User

Try this:

=
VAR MaxUnitPrice =
    MAX ( Table[UnitPrice] )
VAR Result =
    SUMX (
        VALUES ( Table[ProductName] ),
        CALCULATE ( SUM ( Table[Quantity] ), Table[UnitPrice] = MaxUnitPrice )
    )
RETURN
    Result

 

amitchandak
Super User
Super User

@cdawidow , Try like

calculate(sum(Table[qty]), filter(allselected(Table),Table[product] =max(Table[product]) && Table[product] =max(Table[price])))

 

Can you share sample data and sample output in table format?

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Pragati11
Super User
Super User

Hi @cdawidow ,

 

Please detai your issue here. It's hard to understand what you are asking.

Refer following link on how to get your questions answered:

https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.