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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Anonymous
Not applicable

Bold/backgroung color in each last row of each day

Hello
I have a table with several columns. I would like to mark in bold the last row (data sorted in descending order by Col01) in each day. Of course, the background color of such row can be changed instead of bold.
In the example array:

 

Col01 | Col02 | Col03 | Col04
2021-05-25 20:33:05 | 2021-05-25 | Abc | Def
2021-05-25 12:03:44 | 2021-05-25 | Ghi | Jklm
2021-05-25 12:00:16 | 2021-05-25 | No | Nooooo
2021-05-24 19:22:08 | 2021-05-24 | Qwer | Ty
2021-05-24 19:07:04 | 2021-05-24 | Zx | Yzabc
2021-05-24 18:58:06 | 2021-05-24 | Cfff | Fggh
2021-05-24 18:58:01 | 2021-05-24 | Pppp | Wwww
2021-05-24 17:47:17 | 2021-05-24 | Aaaa | Zzzz
2021-05-23 18:44:44 | 2021-05-23 | Jjjj | Iiiii
2021-05-23 18:33:33 | 2021-05-23 | Qwer | Qw
2021-05-23 18:32:23 | 2021-05-23 | We | Are
2021-05-22 02:00:10 | 2021-05-22 | Wi | Fi

 

I would like to have rows 1, 4, 9 and 12 marked.
How can I do this?

2 ACCEPTED SOLUTIONS
mahoneypat
Employee
Employee

Here is one way to do it.  Make the measure below, and use it as the Field Value when conditional formatting the font color of each column.  Here is an example with it on the first column.

 

mahoneypat_0-1621989987787.png

 

Bold Max =
VAR thistime =
    MIN ( Bold[Col01 ] )
VAR maxtime =
    CALCULATE ( MAX ( Bold[Col01 ] )ALL ( Bold )VALUES ( Bold[ Col02 ] ) )
RETURN
    IF ( thistime = maxtime"Blue""Black" )

 

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

v-xulin-mstf
Community Support
Community Support

Hi @Anonymous,

 

You can use the following step:

Create measure as:

MAX_DAY = 
VAR maxtime_day =
    CALCULATE ( MAX ( 'Table'[Col01 ]),FILTER( ALL ('Table'), 'Table'[ Col02 ]=MAX('Table'[ Col02 ]) ))
RETURN
    IF ( MAX('Table'[Col01 ]) = maxtime_day, "Yellow", "White" )

v-xulin-mstf_0-1622171281638.png

Here is the output:

v-xulin-mstf_1-1622171560532.png

 

Currently it is not supported to apply on row with condition formating, you can apply on columns.

You can try the attached pbix.

 

Best Regards,
Link

 

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

4 REPLIES 4
v-xulin-mstf
Community Support
Community Support

Hi @Anonymous,

 

You can use the following step:

Create measure as:

MAX_DAY = 
VAR maxtime_day =
    CALCULATE ( MAX ( 'Table'[Col01 ]),FILTER( ALL ('Table'), 'Table'[ Col02 ]=MAX('Table'[ Col02 ]) ))
RETURN
    IF ( MAX('Table'[Col01 ]) = maxtime_day, "Yellow", "White" )

v-xulin-mstf_0-1622171281638.png

Here is the output:

v-xulin-mstf_1-1622171560532.png

 

Currently it is not supported to apply on row with condition formating, you can apply on columns.

You can try the attached pbix.

 

Best Regards,
Link

 

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

mahoneypat
Employee
Employee

Here is one way to do it.  Make the measure below, and use it as the Field Value when conditional formatting the font color of each column.  Here is an example with it on the first column.

 

mahoneypat_0-1621989987787.png

 

Bold Max =
VAR thistime =
    MIN ( Bold[Col01 ] )
VAR maxtime =
    CALCULATE ( MAX ( Bold[Col01 ] )ALL ( Bold )VALUES ( Bold[ Col02 ] ) )
RETURN
    IF ( thistime = maxtime"Blue""Black" )

 

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Anonymous
Not applicable

@amitchandak 

When creating a measure I get an error at EARLIER: "Parameter is not the correct type" 😞
How can I resolve this?
I'm using Direct Query, and the Col01 column has a Date/time data type.

amitchandak
Super User
Super User

@Anonymous , You can not mark bold, You can do conditional formatting of font color or background color

 

First, create a date column from col1 

 

Date = [Timestamp].date
or
Date = date(year([Timestamp]),month([Timestamp]),day([Timestamp]))

 

 

Then create a rank column

 

Daily Rank =
RANKX(
FILTER(
Table,
Table[Date]=EARLIER(Table[Date])
),
Table[Col1],,desc,dense
)

 

In conditional formatting rule based, color Rank =1

https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-values

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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