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.
Good morning all! I know I need to create a measure for the last four week numbers and this is good as shown here:
Rolling weeks =
VAR endweek = WEEKNUM)Today())
VAR startweek = endweek-4
RETURN
Here is my question though. What am I returning? A table of the two values that I can then apply to the stacked bar visual?
Thanks for the information
Brad
Solved! Go to Solution.
UPDATE: For now I added a new column that is
Show On Visual = if(WEEKNUM('dataset'[Work Date])>WEEKNUM(Today())-4,1,0)
Then I add this filter to the visual where the value is 1 and it works.
Hi @guyinazo ,
What result do you want to return for the measure you created. If you want to get the rolling value within four weeks, you can refer to the following formula.
M =
VAR endweek =
WEEKNUM ( TODAY () )
VAR startweek = endweek - 4
RETURN
CALCULATE (
SUM ( 'Table'[Value] ),
FILTER (
ALL ( 'Table' ),
WEEKNUM ( TODAY () ) >= startweek
&& WEEKNUM ( TODAY () ) <= endweek
)
)
If the problem is still not resolved, no further test can be done just by looking at the formula. Hope to provide a test data model (delete sensitive information) and detailed expected results.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @guyinazo ,
What result do you want to return for the measure you created. If you want to get the rolling value within four weeks, you can refer to the following formula.
M =
VAR endweek =
WEEKNUM ( TODAY () )
VAR startweek = endweek - 4
RETURN
CALCULATE (
SUM ( 'Table'[Value] ),
FILTER (
ALL ( 'Table' ),
WEEKNUM ( TODAY () ) >= startweek
&& WEEKNUM ( TODAY () ) <= endweek
)
)
If the problem is still not resolved, no further test can be done just by looking at the formula. Hope to provide a test data model (delete sensitive information) and detailed expected results.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
UPDATE: For now I added a new column that is
Show On Visual = if(WEEKNUM('dataset'[Work Date])>WEEKNUM(Today())-4,1,0)
Then I add this filter to the visual where the value is 1 and it works.
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.
User | Count |
---|---|
114 | |
100 | |
78 | |
75 | |
50 |
User | Count |
---|---|
144 | |
109 | |
108 | |
88 | |
61 |