March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Sorry for the title being kinda complex - I will try to explain better here:
I have the following (simplified) dataset. Anytime an employee changes (e.g. promoted or switched department) in their record, a new row is added at the end of the month The most recent row is blank.
I also have a date slicer:
I have created a calculated column that changes the blank date into the previous date + 1 month. I also have a measure that will give me the closest date for each employee that is less than the selected date, or if there isn't one, it will give me the calculated column date I just mentioned. To show you what I mean: see the 3 images below. The ID 4364 has the following end dates: 31/03/2022/ 31/07/2022 and blank. Therefore when I select June, the first date is the closest, for July the second date is closest and past July it will give my calculated column of the previous date +1 month (essentially the third blank date).
Here is the measure that gives me the closest date:
What I'm trying to do is run a count on ID based on the selected date that will only use the row that matches the above measure's calculated date for each ID. Here is what I've got so far.. but does not work:
Solved! Go to Solution.
Hi @Bananathan ,
Please have a try.
calculated date for each ID:
You can add the part:
measure =
CALCULATE (
COUNT ( ''[Id] ),
FILTER (
ALL ( 'Data' ),
'Data'[Previous Date + 1 month] = [Latest Selected Date]
&& 'data'[id] = SELECTEDVALUE ( 'data'[id] )
)
)
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Bananathan ,
Please have a try.
calculated date for each ID:
You can add the part:
measure =
CALCULATE (
COUNT ( ''[Id] ),
FILTER (
ALL ( 'Data' ),
'Data'[Previous Date + 1 month] = [Latest Selected Date]
&& 'data'[id] = SELECTEDVALUE ( 'data'[id] )
)
)
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
User | Count |
---|---|
93 | |
92 | |
86 | |
77 | |
49 |
User | Count |
---|---|
166 | |
149 | |
99 | |
73 | |
57 |