Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
a68tbird
Resolver II
Resolver II

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.

a68tbird_0-1733347696917.png

Thanks!

1 ACCEPTED SOLUTION
v-jtian-msft
Community Support
Community Support

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

vjtianmsft_0-1733373403087.png

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:

vjtianmsft_1-1733373501502.png
In Power BI Report Builder
I create a function
 

vjtianmsft_2-1733373522368.png
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

vjtianmsft_3-1733373560327.png

I created a matrix with the following groupings:

vjtianmsft_4-1733373584396.pngvjtianmsft_5-1733373590655.png

You need to pay attention to the grouping of the matrix

vjtianmsft_6-1733373628119.png

=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.

View solution in original post

2 REPLIES 2
v-jtian-msft
Community Support
Community Support

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

vjtianmsft_0-1733373403087.png

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:

vjtianmsft_1-1733373501502.png
In Power BI Report Builder
I create a function
 

vjtianmsft_2-1733373522368.png
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

vjtianmsft_3-1733373560327.png

I created a matrix with the following groupings:

vjtianmsft_4-1733373584396.pngvjtianmsft_5-1733373590655.png

You need to pay attention to the grouping of the matrix

vjtianmsft_6-1733373628119.png

=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.

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!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.