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.
Hi, I am having a strange isssue comparing two values from one column, one table.
Below you will find an example of my datasource.
I want to check if employee id in May = Employee id in April, and in this case for ID 6666 i want to obtain "NS", for ID 7777 "Leaver".
I have prepared few functions but it always gives me false result, meaning that it always says all ids are different.
The employee ID is a type text, i have converted it to numbers (not ideal...) but have not worked either...
Could you pleasehelp me and let me know what i have done wrongly ?
Date | Employee ID |
01 May 2021 | 1111 |
01 April 2021 | 1111 |
01 May 2021 | 2222 |
01 April 2021 | 2222 |
01 May 2021 | 3333 |
01 April 2021 | 3333 |
01 May 2021 | 4444 |
01 April 2021 | 4444 |
01 April 2021 | 5555 |
01 May 2021 | 5555 |
01 May 2021 | 6666 |
01 April 2021 | 7777 |
01 May 2021 | 8888 |
01 April 2021 | 8888 |
01 May 2021 | 9999 |
01 April 2021 | 9999 |
I have tried following as a measure and as a column but the outcome alway was false...
Measure =
Solved! Go to Solution.
https://www.dropbox.com/s/5h0r4sm9xp268yv/kopek.pbix?dl=0
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Hi @Kopek
You need to create two Employee ID List in your measure and compare your values with the List in your measure.
Try this measure:
Measure =
VAR _MAXDate = MAXX(ALL('People reports'),'People reports'[Date])
VAR _MINDate = MINX(ALL('People reports'),'People reports'[Date])
VAR _MaxPeopleList = SUMMARIZE(FILTER(ALL('People reports'),'People reports'[Date] = _MAXDate),'People reports'[Employee ID])
VAR _MinPeopleList = SUMMARIZE(FILTER(ALL('People reports'),'People reports'[Date] = _MINDate),'People reports'[Employee ID])
RETURN
SWITCH(TRUE(),AND(MAX('People reports'[Employee ID]) in _MaxPeopleList,MAX('People reports'[Employee ID]) in _MinPeopleList),"In Two Month",AND(MAX('People reports'[Employee ID]) in _MaxPeopleList,NOT(MAX('People reports'[Employee ID])) in _MinPeopleList),"NS","Leaver")
Result:
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Kopek
You need to create two Employee ID List in your measure and compare your values with the List in your measure.
Try this measure:
Measure =
VAR _MAXDate = MAXX(ALL('People reports'),'People reports'[Date])
VAR _MINDate = MINX(ALL('People reports'),'People reports'[Date])
VAR _MaxPeopleList = SUMMARIZE(FILTER(ALL('People reports'),'People reports'[Date] = _MAXDate),'People reports'[Employee ID])
VAR _MinPeopleList = SUMMARIZE(FILTER(ALL('People reports'),'People reports'[Date] = _MINDate),'People reports'[Employee ID])
RETURN
SWITCH(TRUE(),AND(MAX('People reports'[Employee ID]) in _MaxPeopleList,MAX('People reports'[Employee ID]) in _MinPeopleList),"In Two Month",AND(MAX('People reports'[Employee ID]) in _MaxPeopleList,NOT(MAX('People reports'[Employee ID])) in _MinPeopleList),"NS","Leaver")
Result:
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
https://www.dropbox.com/s/5h0r4sm9xp268yv/kopek.pbix?dl=0
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
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 |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
101 | |
86 | |
64 |