cancel
Showing results for 
Search instead for 
Did you mean: 
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
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Top Solution Authors
Top Kudoed Authors