Forum Discussion
Anonymous
4 years agoNot applicable
Having Trouble in Power Query
@ links to members, content I am new to Power Query. I tried to add this column I am getting error message "Token Literal expected". Here is my DAX in power query = Table.AddColumn(#"Changed...
- 4 years ago
Use this please
= Table.AddColumn(#"Changed Type1", "CalDueFormat", each if [Calibration Due] <= Date.From(DateTime.LocalNow()) then "Overdue" else if [Calibration Due] <= Date.From(Date.AddDays(DateTime.LocalNow(),90)) then "Due in 90 Days" else "In Calibration")
Vijay_A_Verma
4 years agoMost Valuable Professional
Use below formula
= Table.AddColumn(#"Changed Type1", "CalDueFormat", each if [Calibration Due] <= Date.From(DateTime.LocalNow()) then "In Calibration" else if [Calibration Due] <= Date.From(Date.AddDays(DateTime.LocalNow(),90)) then "Due in 90 Days"
else "Overdue")Anonymous
4 years agoNot applicable
Thank you for adjusting the formula, it is returning the expected text string but applying color coding to wrong columns. Where it is saying "In Calibration" it should have "OverDue" and where it is "In Calibration" it should say "OverDue".
This is my color measure
CalColor = SWITCH(
SELECTEDVALUE('DL - Tools, Test Equipment, and Tech Gear'[CalDueFormat]),
"OverDue", "Red",
"Due in 90 Days", "Yellow",
"In Calibration", "Green"
)
I really appreciate your help on this. Getting close to the expected solution.
- Vijay_A_Verma4 years agoMost Valuable Professional
Use this please
= Table.AddColumn(#"Changed Type1", "CalDueFormat", each if [Calibration Due] <= Date.From(DateTime.LocalNow()) then "Overdue" else if [Calibration Due] <= Date.From(Date.AddDays(DateTime.LocalNow(),90)) then "Due in 90 Days" else "In Calibration")