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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors