Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I'm trying to show the data for the selected week and previous week in the same table with below query.
WebAuthSSOWeeklySnapshot =
VAR selectedDate = DATE(2022,9,29)
// VAR selectedDate = SELECTEDVALUE('Filter-date'[Date])
VAR previousDate = CALCULATE(MAX('Filter-date'[Date]), FILTER('Filter-date', 'Filter-date'[Date] < selectedDate))
RETURN UNION(
SELECTCOLUMNS(FILTER('Web SSO WebAuth Health Report', 'Web SSO WebAuth Health Report'[Date] == selectedDate),
"Channel", 'Web SSO WebAuth Health Report'[Channel],
"This Week", 'Web SSO WebAuth Health Report'[Value],
"Previous Week", 0,
"Metrics Name", 'Web SSO WebAuth Health Report'[Metrics Name],
"Platform", 'Web SSO WebAuth Health Report'[Platform]),
SELECTCOLUMNS(FILTER('Web SSO WebAuth Health Report', 'Web SSO WebAuth Health Report'[Date] == previousDate),
"Channel", 'Web SSO WebAuth Health Report'[Channel],
"This Week", 0,
"Previous Week", 'Web SSO WebAuth Health Report'[Value],
"Metrics Name", 'Web SSO WebAuth Health Report'[Metrics Name],
"Platform", 'Web SSO WebAuth Health Report'[Platform])
)
The query works fine if I hard code a date with
VAR selectedDate = DATE(2022,9,29)
but not works when I use
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @LinpingZhang ,
If you run this string of statements alone, that is "VAR selectedDate = SELECTEDVALUE('Filter-date'[Date])",is it returning the correct value? Or does it still not work.
Best regards,
Community Support Team Selina zhu