Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!
Bonjour
Dans une table, j’ai une colonne de produits, une colonne de quantité de produits et une colonne de date de livraison.
Certains produits peuvent avoir plusieurs quantités selon la date de livraison.
Je souhaite créer une mesure, pour une date de livraison choisie, qui compte le nombre de produit en ne gardant que la quantité la plus basse de chaque produit
Merci
Solved! Go to Solution.
Hello,AilleryO,thanks for your concern about this issue.
Your answer is excellent!
And I would like to share some additional solutions below.
Hi,@Jean-Mi64 .I am glad to help you.
1.You can group data using ALL()/ALLSELECTED() +var variables
The var variable gets the current value of each row, enabling grouping calculations.
The measure calculates the minimum number within the same group.
Then you mark the target result as 1 by creating a new measure, and then set the measure to display only the data in the current row with a value of 1.
Like this:
This is my test code:
M_minPerPro =
VAR _groupPorduct =
MIN ( 'TestTable'[Product] )
VAR _result =
CALCULATE (
MIN ( 'TestTable'[Quantities] ),
FILTER ( ALLSELECTED ( 'TestTable' ), 'TestTable'[Product] = _groupPorduct )
)
RETURN
_result
M_Filter =
VAR _groupPorduct = MIN ( 'TestTable'[Product] ) //Get the current product name for each row in the table visual.
VAR _result =
CALCULATE (
MIN ( 'TestTable'[Quantities] ),
FILTER ( ALLSELECTED ( 'TestTable' ), 'TestTable'[Product] = _groupPorduct )
)
VAR _quantities = MIN ( 'TestTable'[Quantities] ) // Get the current Quantities for each row in the table visual.
RETURN
IF ( _quantities = _result, 1, 0 )
2.The same effect can be achieved using ALLEXCEPT():
URL:
ALLEXCEPT function (DAX) - DAX | Microsoft Learn
I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello,AilleryO,thanks for your concern about this issue.
Your answer is excellent!
And I would like to share some additional solutions below.
Hi,@Jean-Mi64 .I am glad to help you.
1.You can group data using ALL()/ALLSELECTED() +var variables
The var variable gets the current value of each row, enabling grouping calculations.
The measure calculates the minimum number within the same group.
Then you mark the target result as 1 by creating a new measure, and then set the measure to display only the data in the current row with a value of 1.
Like this:
This is my test code:
M_minPerPro =
VAR _groupPorduct =
MIN ( 'TestTable'[Product] )
VAR _result =
CALCULATE (
MIN ( 'TestTable'[Quantities] ),
FILTER ( ALLSELECTED ( 'TestTable' ), 'TestTable'[Product] = _groupPorduct )
)
RETURN
_result
M_Filter =
VAR _groupPorduct = MIN ( 'TestTable'[Product] ) //Get the current product name for each row in the table visual.
VAR _result =
CALCULATE (
MIN ( 'TestTable'[Quantities] ),
FILTER ( ALLSELECTED ( 'TestTable' ), 'TestTable'[Product] = _groupPorduct )
)
VAR _quantities = MIN ( 'TestTable'[Quantities] ) // Get the current Quantities for each row in the table visual.
RETURN
IF ( _quantities = _result, 1, 0 )
2.The same effect can be achieved using ALLEXCEPT():
URL:
ALLEXCEPT function (DAX) - DAX | Microsoft Learn
I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Bonjour,
Si vous ne sélectionnez que des dates uniques (et pas des périodes), ceci devrait suffire :
Mesure = CALCULATE( MIN( Quantite ) , ALL( Quantite ) )
Mais il peut y avoir d'autres filtres à gérer ?
Pour des périodes il est possible que l'itération soit nécessaire avec MINX.
Mais difficle d'en dire plus sans mieux connaître la situation.
J'espère que cela répond au besoin...
| User | Count |
|---|---|
| 49 | |
| 37 | |
| 33 | |
| 22 | |
| 18 |
| User | Count |
|---|---|
| 130 | |
| 100 | |
| 56 | |
| 37 | |
| 37 |