Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
hello everyone
i have a fact table have duplicated employees ID and wanna sort it with keeping duplicates and then get the last corresponding value from another column in the same table like following
| EmpID | Value1 | value2 |
| 1 | 100 | 110 |
| 2 | 101 | 111 |
| 3 | 102 | 112 |
| 1 | 103 | 113 |
| 3 | 104 | 114 |
| 2 | 105 | 115 |
| 4 | 106 | 116 |
| 5 | 107 | 117 |
| 4 | 108 | 118 |
| 5 | 109 | 119 |
and i wanna result table as following
| 1 | 103 | 113 |
| 2 | 105 | 115 |
| 3 | 104 | 114 |
| 4 | 108 | 118 |
| 5 | 109 | 119 |
and if there is only one value for any employee then it returns the corresponding values
Solved! Go to Solution.
thanks to all who tried to help me out with this but actually it worked for me using the following measures
thanks to all who tried to help me out with this but actually it worked for me using the following measures
Hi,
Drag EmpID to the Table visual and write these 2 measures
Max of value 1 = max(Data[value1])
Max of value 2 = max(Data[value2])
ok sir I'll try this out
Hi @Islam ,
Is your issue solved now?If so,could you pls mark the reply as answered to close it?
Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!
1. create an index column in pq
2. create two measures
_value1 =
VAR _max=maxx(FILTER('Table','Table'[EmpID]=MAX('Table'[EmpID])),'Table'[Index])
return maxx(FILTER('Table','Table'[Index]=_max),'Table'[Value1])
_value2 =
VAR _max=maxx(FILTER('Table','Table'[EmpID]=MAX('Table'[EmpID])),'Table'[Index])
return maxx(FILTER('Table','Table'[Index]=_max),'Table'[value2])
please see the attachment below
Proud to be a Super User!
thx for help sir but i already have an index column embeded in my fact table so can't i add an index column in the resulted summerized table using dax ?
if you already have an index column then skip the first step and create measure directly
Proud to be a Super User!
ah ok that's a good idea I'll try this and let you know the results
Hi @Islam ,
Create a measure as below:
_index = IF(MAX('Table'[Index])=CALCULATE(MAX('Table'[Index]),FILTER(ALL('Table'),'Table'[EmpID]=MAX('Table'[EmpID]))),1,BLANK())
Then put the measure in the filter pane,choose "is not blank":
And you will see:
For the related .pbix file,pls see attached.
Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!
i'm getting crazy brother i tested your measure and it gives a perfect answers for your model but for mine it gives me both two SubDegreeID like this image
Hi @Islam ,
Dont worry,you should use "ALL" instead of "VALUES"."VALUES" is not suitable here.
Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!
thanks for your help sir but it gave me an empty values like following picture
@Islam Hey ,
Picture 1 . Fact table .
You can use below formula,
thanks for help sir but i'm afraid it doesn't completely work for me because when i swap the values for EmpID number 1 for example it gave me 113 and 103 in values although it should give me 110 and 100
Hey @Islam ,
if it is just 2 columns you can achieve that with the LOOKUPVALUE function in DAX.
Unfortunately it's not exactly what i need sir what i need is generating a table with last values for unique employees
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.