Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I want to create a measure that checks to see if there is an entry between a certain set of dates. The dates are the absolute max date of all entries created, and one year prior to that. The maximum entry date in my data is 12/9/2021, so it should be looking between 12/9/2020-12/9/2021, however it's not working properly. It is telling me that certain accounts have entries made when they are outside of those dates.
Here is my formula:
Hi @Anonymous
You could try this measure
a_Test Home Office =
VAR maxdate = CALCULATE ( MAX ( 'Usage Statistics'[CreateDate] ), ALL ( 'Usage Statistics' ) )
VAR startdate = EDATE ( maxdate, -12 )
RETURN
CALCULATE (
COUNT ( 'Usage Statistics'[ObjectType] ),
'Usage Statistics'[ObjectType] IN { "NB Exhibit Exhibit", "Main Exhibit Account" },
'Usage Statistics'[CreateDate] <= maxdate,
'Usage Statistics'[CreateDate] >= startdate,
'Usage Statistics'[Group] = "Home Office"
)
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
var startdate = CALCULATE(max('Usage Statistics'[CreateDate]),ALL('Usage Statistics'),'Usage Statistics'[CreateDate])>=EDATE(maxdate,-12))
And then you can use a DATESBETWEEN filter.
User | Count |
---|---|
73 | |
72 | |
39 | |
25 | |
23 |
User | Count |
---|---|
96 | |
93 | |
51 | |
43 | |
42 |