Forum Discussion
Filter the contents inside MATRIX visual
- 3 years ago
Actually, thinking about it, the average method could potentially not achieve what you are looking for.
If you have a set of values for a year like {30, 29, 30, 31}, the average method will hide both 30 values.
The following method however will work: compare the minimum value in a set to the maximum value. If they are the same, all values are the same...
So...
No duplicate profits = VAR _Min = MINX ( ALL ( 'Warehouse table'[Warehouse] ), [Your measure] ) VAR _MAX = MAXX ( ALL ( 'Warehouse table'[Warehouse] ), [Your measure] ) RETURN IF ( AND ( ISINSCOPE ( 'Warehouse table'[Warehouse] ), ISINSCOPE ( 'Year Table'[Year] ) ), IF ( _Min = _Max, BLANK (), [Your measure] ) )PS. I tried deleting the previous message but the forum won't let me for that particular post for some reason....
Hi Pi
Thanks a lot, I will try it on Monday.
Until then, I just need to add that the profit value is a measure, not a column .. so I am not sure if this DAX can be applied?
Thanks a gain
Regards
Hi @Thor2022
This is interesting, because for some reason it's not as simple to aggregate a distinct count on another measure! However it is always possible in DAX 😉
I created a new measure rather than chain it in called "New count" which evaluates to the total number of distinct sums. I am use group by to create an aggregated table which I can pass the summed column through to a distinct count.
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | ||
| WH1 | 4 | 2 | 1 | 2 | 3 | 3 | 3 | 3 | |
| WH2 | 4 | 2 | 1 | 2 | 3 | 3 | 3 | 3 | |
| WH3 | 4 | 2 | 1 | 2 | 3 | 3 | 3 | 3 | |
| WH4 | 4 | 2 | 1 | 2 | 3 | 3 | 3 | 3 | |
Added into the final expression gives you:
Let me know if this works,
Pi