Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I have this written this DAX code but its producing the red error bar as per screenshot and I'm not sure why?
Also, could this be better written using Variables possibly?
Into Area Date = if('Cases - Active'[Functional Area] = "Assessment", 'Cases - Active'[tpo_legacycasecreationdate],if('Cases - Active'[Functional Area] = "Casework Support", 'Cases - Active'[new_allocationqueuecaseworksupport], if('Cases - Active'[Functional Area] = "Adjudication", 'Cases - Active'[tpo_datepassedtoadjudication], if('Cases - Active'[Functional Area] = "Early Resolution", 'Cases - Active'[tpo_dateofertacceptance], if('Cases - Active'[Functional Area] = "Assessment" && 'Cases - Active'[Sub Area] = "Assessment Post ERT", 'Cases - Active'[tpo_datepassedfromearlyresolution],0)))))
Thanks,
Solved! Go to Solution.
@ArchStanton
Yes sir, if you have got the correct results already then don't worry about it.
Thanks, writing it like this is definitely easier to understand or possibly debug in future.
The DAX still produces errors though:
@ArchStanton
What does the error say? Are you sure you are creating a calculated column not a measure?
I'm still learning PowerBI so please bare with me.
I can't see an error message but In the right hand corner this RED box appears when I go to the end of the code on line 14:
(and the FunctionalArea names are all in Red Font - does that not sugeest a problem)?
This is a new column that will contain only dates that I will use on my visuals.
Hope that makes sense?
@ArchStanton
Two possibilities I can think of. Either you are creating a measure by mistake or you are creating the column in the another table. In order to see the error you need to hit "Enter" and see the error message at the botom of formula box.
Thanks,
I've hit Enter at the bottom of the Formula Box and nothing happens? Everything is Grey all the way to line 14 but despite this the column has been populated by dates - so could I assume that everything is working and just ignore the red?
Also, the TRUE values such as Assessment, Casework Support etc are the same named values that exist in another table called 'Stage and Area', I'm not sure how that could affect this calculated column as we are in a different table?
Lastly, as this column contains dates that depend on the logical test being TRUE or FALSE, the column was created in the Cases - Active table to compute this. There is no measure icon for this column anywhere.
If you are suggesting this is a measure then should I be seeing this as Meaure in the field bar instead of a Date icon?
Unless I explicitly click on New Measure I cannot see how a measure be created by accident?
Thanks for being patient!
Yes and the red bar is still there.
Like I said previously, the dates have been populated in that column, although there are about a 1,000 empty cells. Maybe I should just ignore it
@ArchStanton
Yes sir, if you have got the correct results already then don't worry about it.
Hi @ArchStanton
Please try
Into Area Date =
VAR FunctionalArea = 'Cases - Active'[Functional Area]
VAR SubArea = 'Cases - Active'[Sub Area]
RETURN
SWITCH (
TRUE,
FunctionalArea = "Assessment", 'Cases - Active'[tpo_legacycasecreationdate],
FunctionalArea = "Casework Support", 'Cases - Active'[new_allocationqueuecaseworksupport],
FunctionalArea = "Adjudication", 'Cases - Active'[tpo_datepassedtoadjudication],
FunctionalArea = "Early Resolution", 'Cases - Active'[tpo_dateofertacceptance],
FunctionalArea = "Assessment"
&& SubArea = "Assessment Post ERT", 'Cases - Active'[tpo_datepassedfromearlyresolution],
0
)
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
97 | |
97 | |
81 | |
77 | |
66 |
User | Count |
---|---|
126 | |
105 | |
103 | |
81 | |
72 |