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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
nsamuel30
New Member

Formatting of multiple rows with a simple DAX

In this scenario, lets say we have a simple table and we want to do formatting of consecutive rows with a specific color then with the help of index table and simple dax we can acheive this in a short time rather than formatting each and every row.

 

Capture1.JPG

Let's say I only want background color for odd accounts like 100,300 and so on.

 

For this, just create a simple index table like this which is shown below

 

Capture2.JPG

 

 

 

 

 

 

Use the account column from this table and use in the visual. Once this is done, we just to use simple dax to create a color column based the condition.

 

The dax which will be used is 

Color = IF(Index_Table[Index]=1,1,IF(Index_Table[Index]=3,1,IF(Index_Table[Index]=5,1,IF(Index_Table[Index]=7,1))))
 
This will bring number 1 infront of odd number accounts.
 
For background color, all you have to do is select the color column for conditional conditional formatting.
 
Capture3.JPGCapture4.JPG
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Hope, this will help you in formatting for multiple rows in a short time.
 
Thanks,
Noel Samuel
 
 
 

 

0 REPLIES 0

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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