Forum Discussion
Anonymous
4 years agoNot applicable
DAX: retrieve the minimum value among the values above another
Hello, I need help from the community I need to find a solution in DAX Let me explain: I have several columns: Item, QuantityA and QuantityB. (QuantityB is from a merge with another tabl...
- 4 years ago
Hi,
Please check the below picture and the attached pbix file.
It is for creating a new table.
New Table = ADDCOLUMNS ( SUMMARIZE ( Data, Data[Articles], Data[QuantityA] ), "@QuantityB", SUMX ( FILTER ( GROUPBY ( FILTER ( ADDCOLUMNS ( Data, "@flag", IF ( Data[QuantityA] < Data[QuantityB], 1 ) ), [@flag] = 1 ), Data[Articles], "@MinB", MINX ( CURRENTGROUP (), Data[QuantityB] ) ), Data[Articles] = EARLIER ( Data[Articles] ) ), [@MinB] ) + 0 )
Jihwan_Kim
Super User
4 years agoHi,
Please check the below picture and the attached pbix file.
It is for creating a new table.
New Table =
ADDCOLUMNS (
SUMMARIZE ( Data, Data[Articles], Data[QuantityA] ),
"@QuantityB",
SUMX (
FILTER (
GROUPBY (
FILTER (
ADDCOLUMNS ( Data, "@flag", IF ( Data[QuantityA] < Data[QuantityB], 1 ) ),
[@flag] = 1
),
Data[Articles],
"@MinB", MINX ( CURRENTGROUP (), Data[QuantityB] )
),
Data[Articles] = EARLIER ( Data[Articles] )
),
[@MinB]
) + 0
)Anonymous
4 years agoNot applicable
Hello,
I have applied your solution and it works perfectly.
Thank you very much for your help.
Sincerely,
FDANIEL