Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hello, I seem help in creating a conditional column based on two different values from different columns
Here is an example
If Level Value = 1 and Hours <= 9, Then Return 1, Else Return 0
If Level Value = 2 and Hours <= 12, Then Return 1, Else Return 0
If Level Value =3 and Hours<= 24, Then Return 1, Else Return 0
If Level Value =0 , Then Return 1
Thank you for your support
This one does not seem working, apologise, i will submit a clear description with real data
Thank you for your answer. But it doe snot seem to be working.. May i kindly request some clarifications on the steps i need to follow?
Hello @JW_van_Holst , Thank you for your answer. But it doe snot seem to be working.. May i kindly request some clarifications on the steps i need to follow?
Here you are.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WslTSUTIE41idaCVDIyDTCM41MgEyjRGyBlDFBhCuMVQxhGtkClUM5VqAmWBuLAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Hours = _t, #"Level Value" = _t, #"New Column Value" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Hours", Int64.Type}, {"Level Value", Int64.Type}, {"New Column Value", Int64.Type}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Conditional Column", each
if
([Level Value]=1 and [Hours]<=9) or
([Level Value]=2 and [Hours]<=12) or
([Level Value]=3 and [Hours]<=24)
then
1
else
0
, type number)
in
#"Added Custom"
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.
| User | Count |
|---|---|
| 5 | |
| 3 | |
| 3 | |
| 3 | |
| 2 |
| User | Count |
|---|---|
| 7 | |
| 5 | |
| 5 | |
| 5 | |
| 4 |