Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hi,
I am new to Dax and would appreciate help with writing a formula for a calculated column that returns the result in the column "EWS/Pack" in the table below.
The conditions are following:
IF [SampleSubTypeIDCode] contains text "Pack" AND [u_axflag] is "Null" or "N", expected outcome "Pack+N" else "Pack + Y",
IF [SampleSubTypeIDCode] contains text "EWS" AND [u_axflag] is "Null" or "N", expected outcome "EWS+N" else "EWS+ Y",
Else [SampleSubTypeIDCode]
Thank you so much in advance!
Solved! Go to Solution.
@Alisea_MI , You can not have 2 else to in if. So rethink on condition
I attempted like this a new column
Switch( True() ,
search("Pack",[SampleSubTypeIDCode],,0) >0 && (Isblank([u_axflag]) || [u_axflag] = "N") , "Pack+N" ,
search("Pack",[SampleSubTypeIDCode],,0) >0 , "Pack + Y" ,
search("EWS",[SampleSubTypeIDCode],,0) >0 && (Isblank([u_axflag]) || [u_axflag] = "N") , "EWS+N" ,
search("EWS",[SampleSubTypeIDCode],,0) >0 , "EWS+ Y" ,
[SampleSubTypeIDCode])
@Alisea_MI , You can not have 2 else to in if. So rethink on condition
I attempted like this a new column
Switch( True() ,
search("Pack",[SampleSubTypeIDCode],,0) >0 && (Isblank([u_axflag]) || [u_axflag] = "N") , "Pack+N" ,
search("Pack",[SampleSubTypeIDCode],,0) >0 , "Pack + Y" ,
search("EWS",[SampleSubTypeIDCode],,0) >0 && (Isblank([u_axflag]) || [u_axflag] = "N") , "EWS+N" ,
search("EWS",[SampleSubTypeIDCode],,0) >0 , "EWS+ Y" ,
[SampleSubTypeIDCode])
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 47 | |
| 36 | |
| 27 | |
| 15 | |
| 15 |
| User | Count |
|---|---|
| 58 | |
| 56 | |
| 38 | |
| 21 | |
| 21 |