Forum Discussion
Employee Status Comparison
- Anonymous2 years ago
Hi AnaAlbano ,
According to your description, here are my steps you can follow as a solution.
(1) My test data is the same as yours.
(2) We can create a measure.
Measure = var _a=CALCULATE(MAX('Table'[Status]),FILTER(ALLSELECTED('Table'),'Table'[Employee ID]=MAX('Table'[Employee ID]) && YEAR(MAX('Table'[Report_date]))=YEAR(EOMONTH('Table'[Report_date],1)) && MONTH(MAX('Table'[Report_date]))=MONTH(EOMONTH('Table'[Report_date],1)))) return IF(ISBLANK(_a),BLANK(),IF(_a=MAX('Table'[Status]),"No change","Change"))(3) Then the result is as follows.
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you Anonymous! I tried that and it partially worked, my problem is to aggregate to show by BU, for exemple. Do you think it could be possible to have as a flag column in the table instead of a measure?
- Anonymous2 years agoNot applicable
Hi AnaAlbano ,
You can create a flag column.
Flag Column = var _a=CALCULATE(MAX('Table'[Status]),FILTER('Table','Table'[Employee ID]=MAX('Table'[Employee ID]) && YEAR('Table'[Report_date])=YEAR(EOMONTH(EARLIER('Table'[Report_date]),-1)) && MONTH('Table'[Report_date])=MONTH(EOMONTH(EARLIER('Table'[Report_date]),-1)))) return IF(ISBLANK(_a),BLANK(),IF(_a='Table'[Status],"No change","Change"))Best Regards,
Neeko Tang
- AnaAlbano2 years agoHelper I
Thank you Anonymous for your hard working to help me! It did work as a column. However, the issue is that the objective is to represent the change from a month to another and in this formula, when the status changes, the flag keeps informing "change". For instance, in June/21, we want to show all status changes from May/21 and not carry the changes that happened in other months.
I tried to upload pbix, but it I cannot see this option. This is my real tabel with fake MyAccess ID:Formula:
Flag Column =
VAR _a=CALCULATE(MAX(Dashboard_HHC[Employee status]),FILTER('Dashboard_HHC',Dashboard_HHC[MyAccess ID]=MAX(Dashboard_HHC[MyAccess ID]) && YEAR(Dashboard_HHC[Report Date_Format])=YEAR(EOMONTH(EARLIER(Dashboard_HHC[Report Date_Format]),-1)) && MONTH(Dashboard_HHC[Report Date_Format])=MONTH(EOMONTH(EARLIER(Dashboard_HHC[Report Date_Format]),-1))))RETURN IF(ISBLANK(_a),BLANK(),IF(_a=Dashboard_HHC[Employee status],"No change","Change"))Report Date_Format MyAccess ID Employee status Flag Column 1/9/2021 xx123 On Leave Change 31/08/2021 xx123 On Leave Change 1/8/2021 xx123 On Leave Change 31/07/2021 xx123 On Leave Change 1/7/2021 xx123 On Leave Change 30/06/2021 xx123 On Leave Change 1/6/2021 xx123 On Leave Change 31/05/2021 xx123 On Leave Change 1/5/2021 xx123 Active No change 30/04/2021 xx123 Active No change 1/4/2021 xx123 Active No change 31/03/2021 xx123 Active No change 1/3/2021 xx123 Active No change 28/02/2021 xx123 Active No change 1/2/2021 xx123 Active No change 31/01/2021 xx123 Active No change 1/1/2021 xx123 Active No change 31/12/2020 xx123 Active No change 1/12/2020 xx123 Active No change 30/11/2020 xx123 Active No change 1/11/2020 xx123 Active No change 31/10/2020 xx123 Active No change 1/10/2020 xx123 Active No change 30/09/2020 xx123 Active No change 1/9/2020 xx123 Active No change 31/08/2020 xx123 Active No change 1/8/2020 xx123 Active No change 31/07/2020 xx123 Active No change 1/7/2020 xx123 Active No change 30/06/2020 xx123 Active No change 1/6/2020 xx123 Active No change 31/05/2020 xx123 On Leave Change 1/5/2020 xx123 On Leave Change 30/04/2020 xx123 On Leave Change 1/4/2020 xx123 On Leave Change 31/03/2020 xx123 On Leave Change 1/3/2020 xx123 On Leave Change 29/02/2020 xx123 On Leave Change 1/2/2020 xx123 On Leave Change
Really appreatite your time on it 🙂
Thank you,Ana