Forum Discussion
baekelal
4 years agoFrequent Visitor
Count rows before current day in visual
Hi, I have a table with information about incidents. For example created and solved date. That table is connected to a date table via the created date. I have now a visual where i easly can coun...
- 4 years ago
baekelal
Now is clear. You have alot of zeros. All records with zero "Oplgelost" Date will line below any selected date. This shall solve the problemTotaal aantal opgeloste incidenten = VAR CurrentDate = MAX ( Kalender[Datum] ) RETURN CALCULATE ( COUNTROWS ( 'Incidenten' ), USERELATIONSHIP ( Incidenten[Opgelost], Kalender[Datum] ), Kalender[Datum] <= CurrentDate, NOT ISBLANK ( Incidenten[Opgelost] ), Incidenten[Opgelost] <> 0 )I kept the NOT ISBLANK condition incase you have blank dates. Please check and let me know
tamerj1
Community Champion
4 years agoHi baekelal
for running total you can use the following
MesureRT =
VAR CurrentDate =
MAX ( 'Date'[Date] )
RETURN
CALCULATE (
COUNTROWS ( 'Table' ),
USERELATIONSHIP ( 'Table'[Resoved Date], 'Date'[Date] ),
'Date'[Date] <= CurrentDate
)and based on Incident Date
Mesure1 =
VAR CurrentDate =
MAX ( 'Date'[Date] )
RETURN
CALCULATE (
COUNTROWS ( 'Table' ),
'Date'[Date] <= CurrentDate
)- baekelal4 years agoFrequent Visitor
Hi again tamerj1 and thanks alot !
The running total for created incidents works.
Only the running total for the solved incident is not correct. It starts way too high.
This is de Dax formula
Totaal aantal opgeloste incidenten =VAR CurrentDate =MAX ( Kalender[Datum] )RETURNCALCULATE (COUNTROWS ( 'Incidenten' ),USERELATIONSHIP ( Incidenten[Opgelost],Kalender[Datum] ),Kalender[Datum] <= CurrentDate)It starts immediatly on 784 where it should start around 3.What is still wrong ?
- tamerj14 years ago
Community Champion
Hi baekelal ,
Try thisTotaal aantal opgeloste incidenten = VAR CurrentDate = CALCULATE ( MAX ( Kalender[Datum] ), USERELATIONSHIP ( Incidenten[Opgelost], Kalender[Datum] ) ) RETURN CALCULATE ( COUNTROWS ( 'Incidenten' ), USERELATIONSHIP ( Incidenten[Opgelost], Kalender[Datum] ), Kalender[Datum] <= CurrentDate )