Forum Discussion

a68tbird's avatar
a68tbird
Icon for Resolver II rankResolver II
1 year ago
Solved

Row Banding in Paginated Report with Row Groups

Hello -

  Has anyone figured out how to correctly band rows when using row groups? Here is my situation. My report has a Parent Group with ShowDate, and then three child groups of City, Venue and then Details which is grouped on Section. I want my end report to apply row banding across the entire ShowDate group - including any rows which have split into individual Sections. For example, one ShowDate may have 4 sections within it, some may only have 1 section. But the row banding should be applied across that whole group. I have tried numerous variations of IIF(RowNumber("ShowDate") MOD 2 = 0, "LightGray", "White") applied to the entire row, or applied only to the parent and child groups. 

I've tried =IIF( CInt(Sum(Fields!ShowDate.Value, "ShowDate").GetHashCode()) MOD 2 = 0, "LightGray", "White" ) and

=IIF( Lookup(Fields!ShowDate.Value, Fields!ShowDate.Value, 1, "ShowDateDataset") MOD 2 = 0, "LightGray", "White" )

Nothing ends up working properly. 

This is what I would like it to end up looking like.

Thanks!

  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi,a68tbird .I am glad to help you.
    I conducted the following test and hope it helps you.
    Like this?

    I have created a matrix
    PS: I created the following test data based on the screenshot as I could not exactly reproduce the data structure in your dataset:


    In Power BI Report Builder
    I create a function
     


    Here is the function code:

    Dim currentGroup As Object
    Dim currentColor As String ="PaleTurquoise"
    
    Public Function GetRowColor(ByVal group As Object) As String
        If Not group.Equals(currentGroup) Then
            currentGroup = group
            If currentColor = "PaleTurquoise" Then
                currentColor = "LightGray"
            Else
                currentColor ="PaleTurquoise"
            End If
        End If
        Return currentColor
    End Function

    I created a matrix with the following groupings:

    You need to pay attention to the grouping of the matrix

    =Code.GetRowColor(Fields!SHOW_DATE.Value)

    You can try using the switch statement
    I hope the following issue is helpful to you.
    URL:
    Solved: Conditional Formatting of Fields in Paginated Repo... - Microsoft Fabric Community
    Solved: Paginated Report Help - Background Conditional For... - Microsoft Fabric Community

    I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
    Best Regards,
    Carson Jian,
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi,a68tbird .I am glad to help you.
    I conducted the following test and hope it helps you.
    Like this?

    I have created a matrix
    PS: I created the following test data based on the screenshot as I could not exactly reproduce the data structure in your dataset:


    In Power BI Report Builder
    I create a function
     


    Here is the function code:

    Dim currentGroup As Object
    Dim currentColor As String ="PaleTurquoise"
    
    Public Function GetRowColor(ByVal group As Object) As String
        If Not group.Equals(currentGroup) Then
            currentGroup = group
            If currentColor = "PaleTurquoise" Then
                currentColor = "LightGray"
            Else
                currentColor ="PaleTurquoise"
            End If
        End If
        Return currentColor
    End Function

    I created a matrix with the following groupings:

    You need to pay attention to the grouping of the matrix

    =Code.GetRowColor(Fields!SHOW_DATE.Value)

    You can try using the switch statement
    I hope the following issue is helpful to you.
    URL:
    Solved: Conditional Formatting of Fields in Paginated Repo... - Microsoft Fabric Community
    Solved: Paginated Report Help - Background Conditional For... - Microsoft Fabric Community

    I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
    Best Regards,
    Carson Jian,
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • a68tbird's avatar
      a68tbird
      Icon for Resolver II rankResolver II

      Bravo! That did the trick. I sure hope DEVs are looking into making this easier. I've come from the Telerik paginated report world, and I don't recall having to create underlying code to accomplish this. 

       

      Thanks again!