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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

Trying to display suspicious entries.

I am trying to make the visualization for trainning entries. The information are pretty strightforward here are the lists of available columns.

Table1
[Entry Date]
[Course Name]
[Percentage]


Eg.

[Entry Date]         [Course Name]    [Percentage]
01/01/2000           Database                50%
02/01/2000           Database                70%
03/01/2000           Database                30%

As can be seen above I wanna display like a warning message on some visuals on entries that the percentage decrease. Or in another case if someone submit an entry with 99% and forgot to submit another one with 100% for over two weeks that will also be a warning message.

Thank you everyone in advance

3 REPLIES 3
sturlaws
Resident Rockstar
Resident Rockstar

Hi @Anonymous 

 

try something like this:

alertFlag =
VAR _course =
    CALCULATE ( SELECTEDVALUE ( entries[course] ) )
VAR _maxDate =
    CALCULATE (
        MAX ( entries[Entry date] ),
        FILTER ( ALL ( entries ), entries[course] = _course )
    )
VAR _maxDatePrevEntry =
    CALCULATE (
        MAX ( entries[Entry date] ),
        FILTER (
            ALL ( entries ),
            entries[course] = _course
                && entries[Entry date] < _maxDate
        )
    )
VAR _difference =
    CALCULATE (
        MAX ( entries[percentage] ),
        FILTER (
            ALL ( entries ),
            entries[course] = _course
                && entries[Entry date] = _maxDate
        )
    )
        - CALCULATE (
            MAX ( entries[percentage] ),
            FILTER (
                ALL ( entries ),
                entries[course] = _course
                    && entries[Entry date] = _maxDatePrevEntry
            )
        )
RETURN
    SWITCH (
        TRUE (),
        entries[course] = _course
            && entries[Entry date] = _maxDate
            && _difference < 0, "Alert",
        _maxDate - _maxDatePrevEntry > 14
            && entries[Entry date] = _maxDate
            && _difference = 0, "Alert",
        BLANK ()
    )

 

Cheers,
Sturla

If this post helps, then please consider Accepting it as the solution. Kudos are nice too.

sorry, forgot to mention that this is the code for a calculated column

Anonymous
Not applicable

image.png
Hi @sturlaws  
It seems like on the switch it can only use measure and not a comlumn because the column name [Coursekey] inside table [Training] cann't be specified. 

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.