Forum Discussion
Rocon
2 years agoFrequent Visitor
Switch function
Hi, I have some trouble with a switch function that operates very slow and I think it's due to an Allselected in some measures but don't know how to fix it, so would be so gelreatful for some help. ...
Rocon
2 years agoFrequent Visitor
Thank you so much for your answer Nuno!
The thing is that the calculations is not that advanced but since I have YTD, YTD FC, YTD LY, Month etc it seems like it takes a lot of the performance. I have a measure like this where I use ALLSELECTED but when I remove the ALLSELECTED from the formula, no value is being displayed:
Absence (Short term) % =
CALCULATE(
DIVIDE([Absence (Short term) Total FTE],
([Active Direct FTE (Exc Temps)]+[Active Indirect FTE (Exc Temps)]),0),
ALLSELECTED(Dim_Attributes[ID])
).
I have these measures that formats the current measure in the period type I want:
Month AC =
VAR CurrentValue = CALCULATE([*Switch_value], Selection_VersionType[AC_FC]="AC")
VAR FormatString = LOOKUPVALUE(
Dim_Attributes[Displayed format],
Dim_Attributes[Sub group],
SELECTEDVALUE(Dim_Attributes[Sub group])
)
RETURN
FORMAT(CurrentValue, FormatString).
Everything is connected to a Dimension table for the specifications, but I can't find a good solution for this or if the formatting and ALLSELECTED function is something I have to work with to get the numbers ok. For the above, I don't have Absence % in any data and only get this from the calculation.
Thanks!
Anonymous
2 years agoNot applicable
Hi Rocon
Can you provide detailed sample pbix file and the results you expect.So that I can help you better. Please remove any sensitive data in advance.
Regards,
Nono Chen