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

red/green kpi light latest reading value

hi



1 ACCEPTED SOLUTION

hi, @Anonymous 

Please note that there is no ";" in the red part.

2.JPG

 

Best Regards,

Lin

Community Support Team _ Lin
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

14 REPLIES 14
v-lili6-msft
Community Support
Community Support

hi, @Anonymous 

For your case, you could try this way as below:

Step1:

Create a flag state measure as below:

Flag = 
VAR latesttimestamp =
    CALCULATE (
        MAX ( 'Table'[timestamp] ),
        FILTER ( ALLSELECTED ( 'Table' ), 'Table'[ID] = MAX ( 'Table'[ID] ) )
    )
RETURN
    IF (
        CALCULATE (
            SUM ( 'Table'[Latitude] ),
            FILTER ( 'Table', 'Table'[timestamp] = latesttimestamp )
        )
            * CALCULATE (
                SUM ( 'Table'[Longitude] ),
                FILTER ( 'Table', 'Table'[timestamp] = latesttimestamp )
            )
            = BLANK (),
        1,
        2
    )

Step2:

Create a circle symbol by this formula

Show Light = UNICHAR(11044)

Step3:

Then drag the [ShowLight] inti a card visual.

Step4:

selected card visual, then click Formatting->Data label->"..." (conditional formatting)

1.JPG

Step4:

Create the conditional formatting by flag measure as below:

2.JPG

Result:

3.JPG

4.JPG5.JPG

 

and here is sample pbix, please try it.

 

Best Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

 

hi, @Anonymous 

"If my ID box havent example sent any location during the last 24 hours give med red light, but if there is long and lat during 24 hours please show me green light? "

I'm a little confused by your description, could you share some simple sample data with your expected output?

 

Best Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

In one ID has not sent any data the last 24 hours like 

ID 1 no long and lat values from 1 oct to 3 oct give me red light. 

If ID one has long and lat values between 1 to 3 oct so give me green light. 

It will check the latest reading for 24 hours gap. If there is long and lat values last 24 hours give me green light if there ''null'' last 2 days give me red. 

I hope this is clear  @v-lili6-msft 

Anonymous
Not applicable

@v-lili6-msft 

your solution is only checking last reading but i want to check last 24 hours. If there is no long and lat values between last 24 hours from example ID 4 give me red. 

But if ID 4 have sent long and lat values last 24 hours give me green. 

Hope this is clear

hi, @Anonymous 

If so, just add a conditional in the formula that judge if the last reading time is last 24 hours, if not then red, else check the logic as above.

Flag = 
VAR latesttimestamp =
    CALCULATE (
        MAX ( 'Table'[timestamp] ),
        FILTER ( ALLSELECTED ( 'Table' ), 'Table'[ID] = MAX ( 'Table'[ID] ) )
    )
RETURN
  

if(DATEDIFF(latesttimestamp,TODAY() ,HOUR )>=0&&DATEDIFF(latesttimestamp,TODAY() ,HOUR )<=24,
    IF (
        CALCULATE (
            SUM ( 'Table'[Latitude] ),
            FILTER ( 'Table', 'Table'[timestamp] = latesttimestamp )
        )
            * CALCULATE (
                SUM ( 'Table'[Longitude] ),
                FILTER ( 'Table', 'Table'[timestamp] = latesttimestamp )
            )
            = BLANK (),
        1,
        2
    ),1)

Best Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

 
Anonymous
Not applicable

 

hi, @Anonymous 

Please note that there is no ";" in the red part.

2.JPG

 

Best Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable



hi, @Anonymous 

For this issue, just change "," to ";" in the formula.

 

Best Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Anyone?

Anonymous
Not applicable

anyone?????

Anonymous
Not applicable

Hi again.

Anyone has solution? What to use calculated column or measure?
How to set it up.

Different ID send out long and lat values during a day.

I need the latest reading for this ID.

If there is long and lar values. Then i choose ID 1 its green light.

If its not its red.

Need to show it in a card Maybe. If dont have any other options???? Any help???

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.