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

Highlight the previous X datapoints on a graph for a certain result

Hello There,

What do i want to achieve?
Basically on a line graph I have the below points plotted. What I want to do is highlight say the previous 5 dots for the value which is say 20. I am aware i can do this via adding it as a measure, deleting the line and just using markers, but i need to create that measure in the first place. Note this 20 could occur anywhere and that 20 may be a different number.

Example Data

Timestamp        Value

2020/06/17 1:00    12

2020/06/17 2:00    15

2020/06/17 3:00    1

2020/06/17 4:00    11

2020/06/17 5:00    13

2020/06/17 6:00    8

2020/06/17 7:00    2

2020/06/17 8:00    20

2020/06/17 9:00    4

Many thanks

1 ACCEPTED SOLUTION
v-xuxinyi-msft
Community Support
Community Support

Hi @BugmanJ 

 

According to my test, it is not possible to highlight the points directly, but it is possible to add Data label for each point and then highlight the corresponding Data Label, here is the procedure:

 

1. Create measures

 

rank = RANKX(ALL('Table'), [Measure 2], , DESC, Dense)

 

 

 

Measure 2 = MAX([Value])

 

 

 

Measure 3 = IF([rank] <= 5, "red", "blue")

 

 

2. As shown in the following screenshot

vxuxinyimsft_0-1711607372936.png

 

vxuxinyimsft_1-1711607403206.png

 

Result:

 

vxuxinyimsft_2-1711607434783.png

 

Best Regards,
Yulia Xu

 

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

2 REPLIES 2
BugmanJ
Resolver I
Resolver I

@v-xuxinyi-msft sorry this does not work, in the data above the following values would be flagged. In addition there could be values higher then 20 too. Its literally the previous 5 rows

 

2020/06/17 4:00    11

2020/06/17 5:00    13

2020/06/17 6:00    8

2020/06/17 7:00    2

2020/06/17 8:00    20

Any further thoughts?

v-xuxinyi-msft
Community Support
Community Support

Hi @BugmanJ 

 

According to my test, it is not possible to highlight the points directly, but it is possible to add Data label for each point and then highlight the corresponding Data Label, here is the procedure:

 

1. Create measures

 

rank = RANKX(ALL('Table'), [Measure 2], , DESC, Dense)

 

 

 

Measure 2 = MAX([Value])

 

 

 

Measure 3 = IF([rank] <= 5, "red", "blue")

 

 

2. As shown in the following screenshot

vxuxinyimsft_0-1711607372936.png

 

vxuxinyimsft_1-1711607403206.png

 

Result:

 

vxuxinyimsft_2-1711607434783.png

 

Best Regards,
Yulia Xu

 

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

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.