Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
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
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
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.
User | Count |
---|---|
16 | |
14 | |
13 | |
12 | |
11 |
User | Count |
---|---|
19 | |
15 | |
15 | |
11 | |
10 |