Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
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