Forum Discussion
Murali777
4 years agoHelper III
Find Min value and overlap value using DAX table
Hello, I have already creatd the summarize table with below columns (step1), And my step 2 is to find the min value from the different strategy and same name. Step 3 : Final out put is, Total N...
- 4 years ago
Hi,
Thank you for your message.
It is for creating a new table, and not for a measure.
Jihwan_Kim
4 years agoSuper User
Hi,
Please check the attached file and the below DAX formula to create a new table.
New Table =
VAR _newtable =
FILTER (
Data,
COUNTROWS ( FILTER ( Data, Data[Name] = EARLIER ( Data[Name] ) ) ) = 2
)
VAR _minvaluetable =
CALCULATETABLE (
Data,
TREATAS (
GROUPBY (
_newtable,
Data[Date],
Data[Name],
"@MinValue", MINX ( CURRENTGROUP (), Data[SumofValues] )
),
Data[Date],
Data[Name],
Data[SumofValues]
)
)
VAR _appletotal =
{ COUNTROWS ( FILTER ( Data, Data[Strategy] = "Apple" ) ) }
VAR _mangototal =
{ COUNTROWS ( FILTER ( Data, Data[Strategy] = "Mango" ) ) }
VAR _overlap =
{ COUNTROWS ( _minvaluetable ) }
VAR _minvalueappletotal =
{
SUMX ( FILTER ( _minvaluetable, Data[Strategy] = "Apple" ), Data[SumofValues] )
}
VAR _minvaluemangototal =
{
SUMX ( FILTER ( _minvaluetable, Data[Strategy] = "Mango" ), Data[SumofValues] )
}
VAR _totaloverlap =
{ SUMX ( _minvaluetable, Data[SumofValues] ) }
RETURN
UNION (
ROW (
"AppleTotal", _appletotal,
"MangoTotal", _mangototal,
"Overlap", _overlap
),
ROW (
"AppleTotal", _minvalueappletotal,
"MangoTotal", _minvaluemangototal,
"Overlap", _totaloverlap
)
)
Murali777
4 years agoHelper III
Hi Jihwan Sir,
It is not showing the second row.
- Jihwan_Kim4 years agoSuper User
Hi,
Thank you for your message.
It is for creating a new table, and not for a measure.
- Murali7774 years agoHelper III
Thank you Jihwan 🙂