The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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)
Solved! Go to Solution.
Try this:
=
VAR MaxUnitPrice =
MAX ( Table[UnitPrice] )
VAR Result =
SUMX (
VALUES ( Table[ProductName] ),
CALCULATE ( SUM ( Table[Quantity] ), Table[UnitPrice] = MaxUnitPrice )
)
RETURN
Result
Try this:
=
VAR MaxUnitPrice =
MAX ( Table[UnitPrice] )
VAR Result =
SUMX (
VALUES ( Table[ProductName] ),
CALCULATE ( SUM ( Table[Quantity] ), Table[UnitPrice] = MaxUnitPrice )
)
RETURN
Result
@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?
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
User | Count |
---|---|
25 | |
12 | |
8 | |
8 | |
5 |
User | Count |
---|---|
28 | |
13 | |
12 | |
12 | |
6 |