The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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 |
---|---|
24 | |
10 | |
8 | |
7 | |
6 |
User | Count |
---|---|
32 | |
12 | |
10 | |
10 | |
9 |