Forum Discussion
Dynamic status calculation
splited to:
status block F
4083379 | 2015-07-01 | 2015-10-01 | FALSE | 7612
4083379 | 2015-12-16 | 2013-01-01 | TRUE | 16615
This table has been split into two by limited value (one for true , other for false)
4083379 | 2016-12-10| blank
If there is a roe in Status Block table with FALSE in limited column and if falls into date selection status is "2"
Else status is "3"
_____________________________________________________________________________________
Service Status =
VAR
STT=[block t period]>0
VAR
STF=[block F period]>0
RETURN
IF
(
STT=TRUE(),
"DEB",
IF
(
STF=TRUE(),
"SUS",
"ACT"
)
)
_____________________________________________________________________________________
where:
_____________________________________________________________________________________
block t period =
COUNTROWS
(
FILTER
(
Services,
COUNTROWS
(
FILTER
(
'status_block t',
'status_block t'[block_out]>[Selected_date_TermActive]
&&
'status_block t'[block_in]<[Selected_date_TermActive]
)
)>0
))
_____________________________________________________________________________________
and
_____________________________________________________________________________________
block F period =
COUNTROWS
(
FILTER
(
Services,
COUNTROWS
(
FILTER
(
'se_block f',
'se_block f'[block_out]>[Selected_date_TermActive]
&&
'se_block f'[block_in]<[Selected_date_TermActive]
)
) >0
))
_____________________________________________________________________________________
and
_____________________________________________________________________________________
_____________________________________________________________________________________
So the question is - what is the best way to calculate status in this scenario when user can select the input date?
Also - filtering is required. For example show all status "1" items for selected date.
- Anonymous8 years ago
HI mantasceponis,
AFAIK, power bi not support to direct filter on date range who generated by two date column.I'd like to suggest you create new table to generate detailed data table and link to original table, then you can direct filter on those date range.
Reference:
Spread revenue across period based on start and end date, slice and dase this using different dates
Regards,
Xiaoxin Sheng
1 Reply
- AnonymousNot applicable
HI mantasceponis,
AFAIK, power bi not support to direct filter on date range who generated by two date column.I'd like to suggest you create new table to generate detailed data table and link to original table, then you can direct filter on those date range.
Reference:
Spread revenue across period based on start and end date, slice and dase this using different dates
Regards,
Xiaoxin Sheng