Forum Discussion
Count Max Sale by User
- 6 years ago
Ah ok I didn't understood that you wanted to have more information than just the counts of max ID's per User_id in your visual. In that case, add a calculated column to your table like this:
IsMaxIDforUserID = VAR _curID = 'User Group Sales'[id] VAR _curUserID = 'User Group Sales'[user_id] RETURN IF(MAXX(FILTER('User Group Sales', 'User Group Sales'[user_id] = _curUserID), [id]) = _curID, TRUE, FALSE)Then, add that column to the visual filter and filter for True. The column indicates if the current row contains the maximum id for the current userID.
Result is this:
Your PBIX updated is here:
https://1drv.ms/u/s!Ancq8HFZYL_aiIw3_VDuajJWrCu52w?e=qNrx0g
Please don't forget to like posts that helped you and mark it as the solution if it answered your question. This will help others to find the answers quikcly as well if searching for similar problems 🙂
Kind regards
Djerro123
-------------------------------
If this answered your question, please mark it as the Solution. This also helps others to find what they are looking for.
Keep those thumbs up coming! 🙂
Hi JarroVGIT thanks for the advice. I don't normally post so it never occured to me to supply a PBIX. I updated the one you sent with a sample from my actual table.
What I'm actually looking for in the measure results is for 1 to be returned for user_id A, which would be the row with the highest id.
So below, the measure New Contracts would return a total of 3. The rows for each user with lower id's would be filtered out.
Ah ok I didn't understood that you wanted to have more information than just the counts of max ID's per User_id in your visual. In that case, add a calculated column to your table like this:
IsMaxIDforUserID =
VAR _curID = 'User Group Sales'[id]
VAR _curUserID = 'User Group Sales'[user_id]
RETURN IF(MAXX(FILTER('User Group Sales', 'User Group Sales'[user_id] = _curUserID), [id]) = _curID, TRUE, FALSE)
Then, add that column to the visual filter and filter for True. The column indicates if the current row contains the maximum id for the current userID.
Result is this:
Your PBIX updated is here:
https://1drv.ms/u/s!Ancq8HFZYL_aiIw3_VDuajJWrCu52w?e=qNrx0g
Please don't forget to like posts that helped you and mark it as the solution if it answered your question. This will help others to find the answers quikcly as well if searching for similar problems 🙂
Kind regards
Djerro123
-------------------------------
If this answered your question, please mark it as the Solution. This also helps others to find what they are looking for.
Keep those thumbs up coming! 🙂