Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreThe FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now
Hi,
I had an excel which had lots of formula and thus it made its working very slow. Now I am in the process of migrating my excel formulas to Power query. I have the below formula in Excel which I am not sure how to convert to PQ formula. Any help would be greatly appreciated.
=IFERROR(@IF([@key]>0,SWITCH([@[Fbase_rate_monthly_fraction]],"Based on Fixed Hours", [@[Total Hours]]<=[@[Ffixed_hours]],"Based on Net Hours", [@[Total Hours]] <= [@[Fnet_hours]],"Based on Total Hours", [@[Total Hours]] <= [@[Ftotal_hours]],"N/A", [@[Total Hours]] <=[@[Ftotal_hours]],FALSE),""),"")
TIA!
Solved! Go to Solution.
Hi @SJHALANI
Give this a go, it assumes that all field names (everything in square brackets) correspond to column names in your table. Add a custom column and enter this in the formula section:
try
if [key] > 0 then {
[Total Hours] <= [Ffixed_hours],
[Total Hours] <= [Fnet_hours],
[Total Hours] <= [Ftotal_hours],
[Total Hours] <= [Ftotal_hours],
false
}{ List.PositionOf(
{
"Based on Fixed Hours",
"Based on Net Hours",
"Based on Total Hours",
"N/A",
false
},
[Fbase_rate_monthly_fraction]
)}
else ""
otherwise ""
I hope this is helpful
Hi @SJHALANI
Give this a go, it assumes that all field names (everything in square brackets) correspond to column names in your table. Add a custom column and enter this in the formula section:
try
if [key] > 0 then {
[Total Hours] <= [Ffixed_hours],
[Total Hours] <= [Fnet_hours],
[Total Hours] <= [Ftotal_hours],
[Total Hours] <= [Ftotal_hours],
false
}{ List.PositionOf(
{
"Based on Fixed Hours",
"Based on Net Hours",
"Based on Total Hours",
"N/A",
false
},
[Fbase_rate_monthly_fraction]
)}
else ""
otherwise ""
I hope this is helpful
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.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 3 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 6 | |
| 6 | |
| 5 |