Forum Discussion
Measure for conditional formatting a card which displays count of incidents
Hello NKotak_Leecare ,
you could use the following measure:
formatting =
SWITCH (
TRUE (),
[IncidentSavesInSelectedInterval] > [lastMonth], "#FF0000",
[IncidentSavesInSelectedInterval] < [lastMonth], "#008000"
)
If I answered your question, please mark my post as solution, Appreciate your Kudos 👍
- NKotak_Leecare3 years ago
Helper III
Thanks!
how are you getting [lastMonth]?
- mlsx43 years ago
Memorable Member
You can do:
last Month= CALCULATE([IncidentSavesInSelectedInterval],PARALLELPERIOD([Date],-1,MONTH))- NKotak_Leecare3 years ago
Helper III
Hi mlsx4
Thank you! I tried using that measure but it is returning Red regardless of the count values. Do you have any idea why it is doing that and how can I resolve it?
- NKotak_Leecare3 years ago
Helper III
Hi Idrissshatila ,
I tried using this measure but it always returns red to me regardless of the difference. Also, I want to show blue if the last month's count and the current month's count are the same. So I modified the measure as below:
PreviousIncidentBar =SWITCH (TRUE (),[NumberOfIncidents_New] > [LastMonth_Incident], "#FF0000",[NumberOfIncidents_New] < [LastMonth_Incident], "#008000",[NumberOfIncidents_New] = [LastMonth_Incident], "#0000FF")LastMonth_Incident = CALCULATE([NumberOfIncidents_New],PARALLELPERIOD('date'[Date],-1,MONTH))NumberOfIncidents_New =//New Incident saves//If BatchID = RecordID, denotes a new subform save, filtered by subform name, and returns NEW INCIDENTS ONLY in the selected time intervalvar number = CALCULATE(COUNT(mainttable[batchid]),FILTER(mainttable, mainttable[BatchID] = mainttable[RecordID]),FILTER(maintable, maintable[FormName] = "IncidentFormName"))returnif(ISBLANK(number),0,number)Thank you!!