Forum Discussion
Anonymous
3 years agoNot applicable
Issue with Top N
Hi All, I am trying to achieve top N scenario Below is the data model I wanted to use same column (ID) as filter twice to achieve this I am using below measure by creating two disconnected...
Anonymous
3 years agoNot applicable
Hi Anonymous ,
I suggest you to create a measure for average value.
Firstly update [OR Filter] measure.
OR Filter =
IF (
OR (
SELECTEDVALUE ( 'Table H'[Id] ) IN ALLSELECTED ( Acc[Id] ),
// Checks if current Account is in slicer selection
SELECTEDVALUE ( 'Table H'[Id] ) IN ALLSELECTED ( 'Non Acc'[Id] )
// Checks if current Non Account is in slicer selection
),
1, // Return 1 if value is selected in one or both of the slicers
0 // Else return 0
)
Measure:
Measure =
VAR _Summairze =
SUMMARIZE (
FILTER ( 'Table S', [OR Filter] = 1 ),
'Table S'[clild Id],
"ID", CALCULATE ( MAX ( 'Table H'[Id] ) ),
"Average of Value", CALCULATE ( AVERAGE ( 'Table D'[Value] ) )
)
RETURN
SUMX ( _Summairze, [Average of Value] )
Add it into TopN filter in Child ID column. Result is as below.
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.
Anonymous
2 years agoNot applicable
Hi Anonymous ,
I have identified the problem. Tried multiple forum but was unable to solve the problem.
The problem is the same clild id's are being associated with multiple Id's
Please find the updated table below for Table H:
| Id | child Id | Sales | Date |
| 1A | 11 | 5 | 20230630 |
| 1A | 12 | 10 | 20230630 |
| 1A | 13 | 5 | 20230630 |
| 2A | 21 | 20 | 20230630 |
| 2A | 23 | 5 | 20230630 |
| 3A | 35 | 15 | 20230630 |
| 3A | 55 | 20 | 20230630 |
| 3A | 65 | 30 | 20230630 |
| 4A | 45 | 20 | 20230630 |
| 1A | 11 | 5 | 20230731 |
| 1A | 12 | 10 | 20230731 |
| 1A | 13 | 5 | 20230731 |
| 2A | 21 | 20 | 20230731 |
| 2A | 23 | 5 | 20230731 |
| 3A | 35 | 15 | 20230731 |
| 4A | 45 | 20 | 20230731 |
| 3A | 55 | 20 | 20230731 |
| 3A | 65 | 30 | 20230731 |
| 1A | 35 | 15 | 20230731 |
| 2A | 11 | 15 | 20230731 |
| 1A | 65 | 5 | 20230731 |
| 5A | 55 | 5 | 20230731 |
just to make sure added new account as well in Table E:
| Id | Type |
| 1A | Acc |
| 2A | Non Acc |
| 3A | Acc |
| 4A | Non Acc |
| 5A | Acc |
Please see the results below:
Can you please suggest.
Thanks in advance