Forum Discussion
dynamic conditinal formatting based on mtrix condition
- Anonymous7 years ago
Hi there,
This one works and I did conditional formatting based on that
Formatting =VAR Percentage = [Actual Vs Budget]VAR CheckExpand = Not(HASONEVALUE(GLedger[Month Name])) ||Not(HASONEVALUE(GLedger[GL_ACCT_TYPE])) || NOT(HASONEVALUE(GLedger[DD]))RETURNIf(CheckExpand = TRUE(),Percentage,0)ThanksOded Dror - 7 years ago
Hi Anonymous ,
Glad I could give some pointers to get the solution don't forget to mark your result as the answer for this post to help others.
Regards,
MFelix
Hi there,
this is my calculation - no error there but when I put this measure in my marrix I'm getting this error (see below)
VAR Percentage =
Divide(((Sum('ActualVsBudget'[Activity_YTD]) - Sum(ActualVsBudget[BUD_YTD]))) , Sum(ActualVsBudget[BUD_YTD]) )
VAR CheckExpand =
NOT ( HASONEVALUE ( 'GLedger'[Account]) )
RETURN
SWITCH (
TRUE(),
CheckExpand
&& Percentage < 0,0.1, "Yellow",
CheckExpand
&& Percentage > 0,0.1, "Red"
)
Error Message:
MdxScript(Model) (34, 31) Calculation error in measure 'GLedger'[Formatting]:
Function 'SWITCH' does not support comparing values of type True/False with values of type Number.
Consider using the VALUE or FORMAT function to convert one of the values.
Hi there,
I modify the measure and got it to work but it still showing flags when th ematrix is expandad
- MFelix7 years agoSuper User
Hi Anonymous ,
Is the 'GLedger'[DD] the lowest level of your matrix? is it the last level when you expand your matrix?
Can you share a sample file?
Regards,
MFelix
- Anonymous7 years agoNot applicable
Yes, but it dosen't seems working correctly.
I do have multiple column in the header that drill down and the measure hiding some of the values based on that.
I realize that we can't do conditional formatting on sub total or total without including the detail rows.
I gave up (Iv'e tried all the column in the matrix one by one and it desen't produce the expected results - maybe Microsoft will address that issue - conditional formatting is different between table and matrix)
You don't have to spend time on this issue - you can close it - you see we can't even close an issue without mark it as solution
Thank you
Oded Dror
- MFelix7 years agoSuper User
Hi Anonymous ,
If you are abble to share a sample file I can take a look at it, because since the calculation is based on a measure the context can change the result.
If you have sensative data please share it in private message.
Regards,
MFelix
- Anonymous7 years agoNot applicable
Hi there,
I realize the calculation % (Actual Vs Budget) is wrong thats cause the formating to be wrong i need to calculate %
based on condition of th ematrix then apply the conditional formating to it. Let me work on that and get back to you if I need more help.Thanks,
Oded Dror
- Anonymous7 years agoNot applicable
Hi there,
This one works and I did conditional formatting based on that
Formatting =VAR Percentage = [Actual Vs Budget]VAR CheckExpand = Not(HASONEVALUE(GLedger[Month Name])) ||Not(HASONEVALUE(GLedger[GL_ACCT_TYPE])) || NOT(HASONEVALUE(GLedger[DD]))RETURNIf(CheckExpand = TRUE(),Percentage,0)ThanksOded Dror - MFelix7 years agoSuper User
Hi Anonymous ,
Glad I could give some pointers to get the solution don't forget to mark your result as the answer for this post to help others.
Regards,
MFelix