Forum Discussion
Anonymous
4 years agoNot applicable
CONDITIONAL DATES
Hi, I'm developing a daily report in Power BI, but if the user select a date where there´s no data, Power BI should select data from the last date with information: CASE 1 - The user selected...
- 4 years ago
Try:
Sum Values = VAR MaxDate = MAXX(FILTER(ALL(Table[Date), Table[Date] <= SELECTEDVALUE(IndDate[Date]) && NOT(ISBLANK(SUM(Table[Values])))), Table[Date]) RETURN CALCULATE(SUM(Table[Values]), FILTER(ALL(Table[Date]), Table[Date] = MaxDate)
v-zhangti
4 years agoCommunity Support
Hi, Anonymous
Create a new calendar table.
Date = CALENDAR(MIN('Table'[Date]),MAX('Table'[Date]))
New measure takes the date selected in the slicer.
New Date = MAX('Date'[Date])
Output date =
IF (
[New Date] = MAX ( 'Table'[Date] ),
CALCULATE (
MAX ( 'Table'[Date] ),
FILTER ( ALL ( 'Table' ), [Date] = MAX ( 'Table'[Date] ) )
),
CALCULATE (
MAX ( 'Table'[Date] ),
FILTER ( ALL ( 'Table' ), [Date] < MAX ( 'Date'[Date] ) )
)
)
New Facilities =
CALCULATE (
MAX ( 'Table'[Facilities] ),
FILTER ( ALL ( 'Table' ), [Output date] = MAX ( 'Table'[Date] ) )
)
New value =
CALCULATE (
MAX ( 'Table'[Values] ),
FILTER ( ALL('Table'), [Date] =MAX('Table'[Date] ) )
)
Is this the case when the date slicer you mentioned is selected as a parameter? If you have any other questions, please reply.
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
4 years agoNot applicable
Hello,
I would like to thank you all for your help.
You really saved me hours of work.
Benedito_1967.