Hi ST1: here's our version of conditional formatting for base accounts.
This is a Dashboard XFBR String business rule named: XFBR_FormattingHelper
If args.FunctionName.XFEqualsIgnoreCase("InAccountIsBase") Then
'2023-12-19 | D.B. | Create a giant list to compare against for conditional formatting checks
'Usage: In Cube View Conditional Formatting
'Usage Example: If (RowE1MemberName In XFBR(XFBR_FormattingHelper, InAccountIsBase, TopAccount=[TopAccountOfHierarchy])) Then
Dim topAccount As String = args.NameValuePairs.XFGetValue("TopAccount")
Dim accountId As Integer = BRApi.Finance.Members.GetMemberId(si, DimType.Account.Id, topAccount)
Dim baseMembers As List(Of Member) = BRApi.Finance.Members.GetBaseMembers(si, BRApi.Finance.Dim.GetDimPk(si, "AllAccounts"), accountId)
Dim strBaseMembers As String = "'" + String.Join("','", baseMembers.Select(Function(x) x.Name)) + "'"
Return strBaseMembers
End If
Note! you need to modify the piece in red to your application.
A real-world example of usage to apply the conditional formatting (per my application/dimension/member names). This is in a Header Format of a row that contains a A#IncomeStatement.Tree expansion
If (RowE1MemberName In XFBR(XFBR_FormattingHelper, InAccountIsBase, TopAccount=[IncomeStatement])) Then
TextColor = Red
End If
Cheers, -db