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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
shobhagollapudi
New Member

If value same for 3 months in any rolling 6 month period

Hi I have a query where I am tying to compare and assign RAG status for any 3 months values in a rolling 6 months period. For example If the % is less than 75% then assign RED etc.

Example data:

 

DateValueTarget %
01/10/2023602750.23%
01/11/2023895074.58%
01/12/2023850070.83%
01/01/20241150095.83%
01/02/2024493141.09%
01/03/2024562946.91%
2 ACCEPTED SOLUTIONS
ryan_mayu
Super User
Super User

do you mean mark the number in red?

 

i think conditional formatting can work for that.

 

https://learn.microsoft.com/en-us/power-bi/create-reports/desktop-conditional-table-formatting?wt.mc...





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

@shobhagollapudi 

Here is a workaround for you, you can create columns to find out the percentage that you need to mark.

Column =
var _start=maxx(FILTER('Table','Table'[Date]=EDATE(EARLIER('Table'[Date]),-5)),'Table'[Date])
var _count=CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[Date]<=EARLIER('Table'[Date])&&'Table'[Date]>=_start&&'Table'[Target %]<0.75))
return if(ISBLANK(_start),BLANK(),if(_count>2,1))
 
Column 2 =
VAR _end=maxx(FILTER('Table','Table'[Date]=EDATE(EARLIER('Table'[Date]),5)),'Table'[Date])
VAR _max=max('Table'[Date])
return if(ISBLANK(_end)&& MAXX(FILTER('Table','Table'[Date]>=EARLIER('Table'[Date])&&'Table'[Date]<=_max&&'Table'[Column]=1),'Table'[Column])=1 && 'Table'[Target %]<0.75,"RED",if(MAXX(FILTER('Table','Table'[Date]>=EARLIER('Table'[Date])&&'Table'[Date]<=_end&&'Table'[Column]=1),'Table'[Column])=1 && 'Table'[Target %]<0.75,"RED"))
 

11.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

3 REPLIES 3
shobhagollapudi
New Member

@ryan_mayu  Thanks for your response. I understand the conditional format but what the query should look for if the value is less than 75% for any 3 months of the rolling 6 months then apply conditional format

@shobhagollapudi 

Here is a workaround for you, you can create columns to find out the percentage that you need to mark.

Column =
var _start=maxx(FILTER('Table','Table'[Date]=EDATE(EARLIER('Table'[Date]),-5)),'Table'[Date])
var _count=CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[Date]<=EARLIER('Table'[Date])&&'Table'[Date]>=_start&&'Table'[Target %]<0.75))
return if(ISBLANK(_start),BLANK(),if(_count>2,1))
 
Column 2 =
VAR _end=maxx(FILTER('Table','Table'[Date]=EDATE(EARLIER('Table'[Date]),5)),'Table'[Date])
VAR _max=max('Table'[Date])
return if(ISBLANK(_end)&& MAXX(FILTER('Table','Table'[Date]>=EARLIER('Table'[Date])&&'Table'[Date]<=_max&&'Table'[Column]=1),'Table'[Column])=1 && 'Table'[Target %]<0.75,"RED",if(MAXX(FILTER('Table','Table'[Date]>=EARLIER('Table'[Date])&&'Table'[Date]<=_end&&'Table'[Column]=1),'Table'[Column])=1 && 'Table'[Target %]<0.75,"RED"))
 

11.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




ryan_mayu
Super User
Super User

do you mean mark the number in red?

 

i think conditional formatting can work for that.

 

https://learn.microsoft.com/en-us/power-bi/create-reports/desktop-conditional-table-formatting?wt.mc...





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel

Power BI Monthly Update - May 2024

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