Forum Discussion
Anonymous
3 years agoNot applicable
Top N basis the filter value
I have a dataset which contains the Name and Joining Date and Salary of some employees. (Hypothetical Scenario, real scenario is different) I have put the Name in the filter. Now I have colum...
- 3 years ago
Hi,
I tried to create a sample pbix file like below.
please check the below picture and the attached pbix file.
I hope the below can provide some ideas on how to create a solution for your datamodel.
Salary expected top10 measure: = VAR _slicerselect = MAX ( 'Employee slicer'[Employee] ) VAR _slicerselectjoindate = CALCULATE ( MAX ( Employee[Join date] ), Employee[Employee] = _slicerselect ) VAR _top10table = TOPN ( 10, FILTER ( ALL ( Employee ), Employee[Join date] <= _slicerselectjoindate ), Employee[Join date], DESC ) RETURN CALCULATE ( SUM ( Employee[Salary] ), KEEPFILTERS ( _top10table ) )
Anonymous
3 years agoNot applicable
Hi, one more questions, what if the values are repeated, instead of joining date, you can take them as start of month date and value is repeating no fix number of times, then how can the sum of salary show as per the filter criteria?
Jihwan_Kim
3 years agoSuper User
Hi,
Could you please provide a sample pbix file's link together with how expected outcome looks like?