Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Sign up nowGet Fabric certified for FREE! Don't miss your chance! Learn more
Dear DAX collegues,
I stumbled over a - maybe - trivial problem, but cannot solve it:
I'd like to create a measure that give the name of the product with max production duration per day.
I've got one table that has [Product], [Minutes] and [Date]
The second table shows the used raw materials per Date - here I'd like to create the measure.
For a given day, I have e.g. three product produced:
A 340 min
B 700 min
C 194 min
I tried to use TopN(1;'Products;Products[Minutes];DESC)) to give the top 1 row of the products (= B | 700 min).
But now, this result is obviously a single row, but what I do like to have now is just the value "B".
Thanks in advance for your ideas!
Solved! Go to Solution.
you can use the syntax you posted as filter parameter in CALCULATE
Measure = VAR Top1 = TopN(1,'Products',Products[Minutes],DESC) RETURN CALCULATE(FIRSTNONBLANK(Products[Product],TRUE),Top1)
Hi @Anonymous
You may try to use below measure:
Measure =
CALCULATE (
VALUES ( 'Product'[Product] ),
TOPN ( 1, 'Product', 'Product'[Minutes], DESC )
)
Regards,
Cherie
you can use the syntax you posted as filter parameter in CALCULATE
Measure = VAR Top1 = TopN(1,'Products',Products[Minutes],DESC) RETURN CALCULATE(FIRSTNONBLANK(Products[Product],TRUE),Top1)
Great! Works absolutly fine!
Thanks, Stachu!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 19 | |
| 10 | |
| 8 | |
| 7 | |
| 7 |
| User | Count |
|---|---|
| 51 | |
| 43 | |
| 28 | |
| 27 | |
| 25 |