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 CatalinaMur
Create a New Column:
Add a calculated column in Power BI that checks for any 1 in your validation columns:
AnyValidationMissing =
IF(
'YourTable'[Validation 1] +
'YourTable'[Validation 2] +
'YourTable'[Validation 3] > 0,
1,
0
)
Filter Your Visual:
Add the AnyValidationMissing column to the Filters pane and set it to show only rows where AnyValidationMissing = 1.
This will ensure that your visual only shows rows where any validation failed (1).
Did I answer your question? Mark my post as a solution, this will help others!
If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂
Kind Regards,
Poojara
Data Analyst | MSBI Developer | Power BI Consultant
Consider Subscribing my YouTube for Beginners/Advance Concepts: https://youtube.com/@biconcepts?si=04iw9SYI2HN80HKS