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.
Hello guys,
In Table 1, I have 2 date columns and 1 date differnce column. In 4th column, I wrote a simple query to classify date differnce to create groupings. (see screenshot 1). I am showing the count of each grouping on the Dashboard.
The Table 2 is 'Date Table' (see screenshot 2) and both tables are linked with Date columns.
> On Dashboard I also have a filter from Table 2 which will allow user to select random date from past.
> Is it possible to recalculate date difference between Date 1 (from Table 1) and Date selected by user. After this i want to show updated grouping count on dashboard.
I tried creating some measures but it is not evaluating dynamically. Can you help me with this?
Solved! Go to Solution.
@lbendlin , Following solution worked for me:-
1. Measure on Date Table:
Hi @Anonymous ,
Just to supplement Ibendlin’s reply, you could use ABS() function to return positive values.
You need two measures. One for the datediff
datedifference =
var sel = selectedvalue(slicerdate)
return datediff([date 1],[sel])
and one for the bucketing/grouping
grouping =
switch (true(), datedifference<11,"0-10",datedifference<21,"10-20",..."longer")
@lbendlin, Thanks for your reply.
In following measure, how can we use date 1 column as attribute directly in formula. System does not allow to use column while creating measure. Please correct me if I am understanding it wrong.
datedifference =
var sel = selectedvalue(slicerdate)
return datediff([date 1],[sel])
My requirement was to re-evaluate whole DateDiff and Grouping column for each row after user selects the date from slicer, so that I grouping count get directly updated on dashobard.
use max() or selectedvalue() or similar.
I also omitted the last parameter of datediff - you need to set that to days.
@lbendlin , Following solution worked for me:-
1. Measure on Date Table:
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.