Forum Discussion
Multiple validation with multiple print info
- 1 year ago
CatalinaMur
If your all the columns are calculated column and you are bound to create those conditions in DAX then create a calculated table.
You can use below codeoutput = VAR _1 = ADDCOLUMNS( SUMMARIZE( 'Table', 'Table'[ID],'Table'[Validation 1] ), "ColName","Validation 1" ) VAR _2 = ADDCOLUMNS( SUMMARIZE( 'Table', 'Table'[ID],'Table'[ Validation 2] ), "ColName","Validation 2" ) VAR _3 = ADDCOLUMNS( SUMMARIZE( 'Table', 'Table'[ID],'Table'[ Validation 3] ), "ColName","Validation 3" ) VAR _tbl = SELECTCOLUMNS( UNION( _1,_2,_3 ),"Id",[ID],"Flag",[Validation 1],"ColName",[ColName] ) VAR _condition = ADDCOLUMNS( _tbl,"@Condition", IF( [ColName] = "Validation 1" && [Flag] = 1 , "Missing financial info", IF( [ColName] = "Validation 2" && [Flag] = 1, "Data are not align", IF( [ColName] = "Validation 3" && [Flag] = 1, "other" ) ) )) VAR _Result = ADDCOLUMNS( SUMMARIZE( 'Table','Table'[ID] ),"Validation 1", MAXX( FILTER( _condition,[ID] = 'Table'[ID] && [ColName] = "Validation 1" ),[@Condition] ), "validation 2", MAXX( FILTER( _condition,[ID] = 'Table'[ID] && [ColName] = "Validation 2" ),[@Condition] ), "Validation 3", MAXX( FILTER( _condition,[ID] = 'Table'[ID] && [ColName] = "Validation 3" ),[@Condition] ) ) RETURN _ResultBelow screenshot
Attaching pbix file for your reference
Hope it helps
Regards
sanalytics
Hi, thanks, I understand what you all agree, unpivot is a good way to summarize info... But these columns are with DAX formulas with the final result 1 or 0. I just want to try to find a way to summarize more (in power bi) to include in an email with power automate
CatalinaMur
If your all the columns are calculated column and you are bound to create those conditions in DAX then create a calculated table.
You can use below code
output =
VAR _1 =
ADDCOLUMNS(
SUMMARIZE( 'Table', 'Table'[ID],'Table'[Validation 1] ),
"ColName","Validation 1"
)
VAR _2 =
ADDCOLUMNS(
SUMMARIZE( 'Table', 'Table'[ID],'Table'[ Validation 2] ),
"ColName","Validation 2"
)
VAR _3 =
ADDCOLUMNS(
SUMMARIZE( 'Table', 'Table'[ID],'Table'[ Validation 3] ),
"ColName","Validation 3"
)
VAR _tbl =
SELECTCOLUMNS(
UNION(
_1,_2,_3
),"Id",[ID],"Flag",[Validation 1],"ColName",[ColName]
)
VAR _condition =
ADDCOLUMNS(
_tbl,"@Condition",
IF(
[ColName] = "Validation 1" && [Flag] = 1 ,
"Missing financial info",
IF(
[ColName] = "Validation 2" && [Flag] = 1,
"Data are not align",
IF(
[ColName] = "Validation 3" && [Flag] = 1,
"other"
) ) ))
VAR _Result =
ADDCOLUMNS(
SUMMARIZE(
'Table','Table'[ID]
),"Validation 1",
MAXX(
FILTER(
_condition,[ID] = 'Table'[ID] &&
[ColName] = "Validation 1"
),[@Condition]
), "validation 2",
MAXX(
FILTER(
_condition,[ID] = 'Table'[ID] &&
[ColName] = "Validation 2"
),[@Condition]
),
"Validation 3",
MAXX(
FILTER(
_condition,[ID] = 'Table'[ID] &&
[ColName] = "Validation 3"
),[@Condition]
)
)
RETURN
_Result
Below screenshot
Attaching pbix file for your reference
Hope it helps
Regards
sanalytics