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
CalebR
Resolver I
Resolver I

Highlight Row in Table Based Off Date

I have a table with all of our transaction history, I have created a table visual by extracting the yearmonth from the TransactionDate and summed the Qtys with a measure. 

My table looks like this 

yearmonthUsage
2022/040
2022/050
2022/060
2022/070
2022/080
2022/090
2022/100
2022/110
2022/120
2023/010
2023/020
2023/0325


I want to highlight the last six months in green like this :

yearmonthUsage
2022/040
2022/050
2022/060
2022/070
2022/080
2022/090
2022/100
2022/110
2022/120
2023/010
2023/020
2023/0325

Ive tried using the cell elements tab and applying a measure to the background color using the "rules" format style but so far it is just returning like this.

CalebR_0-1682431285426.png

Does anyone know any way of doing this? Am I missing something obvious? 

Thank you in advance for any help.

My background formatting 

CalebR_1-1682431348949.png


My last six months measure: 

Last 6 Monthsv2 =
VAR yearmonthtest = SELECTEDVALUE(IM_ItemTransactionHistory[yearmonth])
Return
    IF(  yearmonthtest >= FORMAT(DATE(YEAR(TODAY()), MONTH(TODAY())-6, 1), "yyyy/MM"), 1, 0)







1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @CalebR 

 

You can try the following methods.

Color Measure = IF(SELECTEDVALUE('Table'[yearmonth])>=EOMONTH(MAXX(ALL('Table'),[yearmonth]),-6)+1,"Green",BLANK())

vzhangti_0-1682562184716.pngvzhangti_2-1682562217838.png

vzhangti_1-1682562204607.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

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

3 REPLIES 3
v-zhangti
Community Support
Community Support

Hi, @CalebR 

 

You can try the following methods.

Color Measure = IF(SELECTEDVALUE('Table'[yearmonth])>=EOMONTH(MAXX(ALL('Table'),[yearmonth]),-6)+1,"Green",BLANK())

vzhangti_0-1682562184716.pngvzhangti_2-1682562217838.png

vzhangti_1-1682562204607.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

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

Really weird, it works perfect in your provided pbix file but in my report it just refuses to let me do it. Thank you anyway for your help. Marking this as the solution as it does indeed work just not in my instance for some reason. 

 

thanks!

This is precisely what I need but how were you able to select the measure in the formatting pane? Mine will not let it be selected and highlights that box in red instead. 

CalebR_0-1682607758863.png

 

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.