Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers!
Enter the sweepstakes now!Preparing for a certification exam? Ask exam experts all your questions on May 15th. Register now.
Hi All,
Below is the sample data
Column 1 Column2
EMEN -OTT | OLX |
EIN -OTT | OLX |
EMEN -OTT | OIA |
ANIN -OTT | TRS |
EMEN -OTT | BHT |
EMEN -OTT | STA |
EMEN -OTT | STI |
ABIN-OTT | OLX |
BCID-OTT | OIA |
CFTU-OTT | OIA |
Now i want a Dax column or conditional column such that
if(table(colum2) = OLX || TRS and if(table(colum2) = OIA||BHT and if(table(colum1) = Start with "EMEN" then it should show "State coverd" and if(table(colum2)= STA||STI then "Current State" and rest all "not covered"
Solved! Go to Solution.
Hi, @chotu27
Based on your description, you may try the following formulas.
formula1 =
IF(
OR('Table'[Column2]="OLX",'Table'[Column2]="TRS")&&
LEFT('Table'[Column1],4)="EMEN",
"State Covered",
IF(
OR('Table'[Column2]="OIA",'Table'[Column2]="BHT")&&
LEFT('Table'[Column1],4)="EMEN",
"State Covered",
IF(
OR('Table'[Column2]="STA",'Table'[Column2]="STI"),
"Current State",
"not covered"
)
)
)
formula2 =
SWITCH(
TRUE(),
OR('Table'[Column2]="OLX",'Table'[Column2]="TRS")&&LEFT('Table'[Column1],4)="EMEN","State Covered",
OR('Table'[Column2]="OIA",'Table'[Column2]="BHT")&&LEFT('Table'[Column1],4)="EMEN","State Covered",
OR('Table'[Column2]="STA",'Table'[Column2]="STI"),"Current State",
"not covered"
)
Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @chotu27
Based on your description, you may try the following formulas.
formula1 =
IF(
OR('Table'[Column2]="OLX",'Table'[Column2]="TRS")&&
LEFT('Table'[Column1],4)="EMEN",
"State Covered",
IF(
OR('Table'[Column2]="OIA",'Table'[Column2]="BHT")&&
LEFT('Table'[Column1],4)="EMEN",
"State Covered",
IF(
OR('Table'[Column2]="STA",'Table'[Column2]="STI"),
"Current State",
"not covered"
)
)
)
formula2 =
SWITCH(
TRUE(),
OR('Table'[Column2]="OLX",'Table'[Column2]="TRS")&&LEFT('Table'[Column1],4)="EMEN","State Covered",
OR('Table'[Column2]="OIA",'Table'[Column2]="BHT")&&LEFT('Table'[Column1],4)="EMEN","State Covered",
OR('Table'[Column2]="STA",'Table'[Column2]="STI"),"Current State",
"not covered"
)
Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I doubt on few and condition, but you can get like
if(table(colum2) in {"OLX", "TRS"} && table(colum2) = in {"OIA", "BHT"} && search("EMEN",table(colum1),1) >0 , "State coverd"
, if(table(colum2) in {"STA","STI"} , "Current State" , "not covered"))
if(table(colum2) in {"OLX", "TRS","OIA", "BHT"} && search("EMEN",table(colum1),1) >0 , "State coverd"
, if(table(colum2) in {"STA","STI"} , "Current State" , "not covered"))
Or use use Switch True
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges
Connect on Linkedin
You might need to make some adjustments, but a column with a switch statement should do the job.
ColumnName = switch(
true();
if(or(table[column2]="OLX";table[column2]="TRS");"State Covered";blank());
if(or(table[column2]="OIA";table[column2]="BHT");"State Covered";blank());
if(left(table[column1];4)="OMEN";"State Covered";blank());
if(or(table[column2]="STA";table[column2]="STI";"Current State";blank());
"Not covered")
when colum1 of "OIA" and "BHT " along with column2 of starts with "EMEN" then also it should be "State Covered"
Check out the April 2025 Power BI update to learn about new features.
Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.
User | Count |
---|---|
76 | |
74 | |
69 | |
47 | |
41 |
User | Count |
---|---|
63 | |
42 | |
30 | |
30 | |
28 |