Forum Discussion
Counting based on another field
- 4 years ago
douglas-verdum So generally you would have a relationship between your date table and that table based on date and you would use Month or something like that from your date table in the axis of your visual. Also, if the = 4 part can be in any month, you would need a slight variation:
Measure = VAR __Table = DISTINCT(SELECTCOLUMNS(FILTER(ALL('Table'), [IdNatureza] = 4), "__Matricula", [Matricula])) VAR __Table1 = DISTINCT(SELECTCOLUMNS(FILTER('Table', [IdMotivo] = 1), "__Matricula", [Matricula])) RETURN COUNTROWS(INTERSECT(__Table1, __Table))
douglas-verdum Maybe something like:
Measure =
VAR __Table = DISTINCT(SELECTCOLUMNS(FILTER('Table', [IdNatureza] = 4), "__Matricula", [Matricula]))
VAR __Table1 = DISTINCT(SELECTCOLUMNS(FILTER('Table', [IdMotivo] = 1), "__Matricula", [Matricula]))
RETURN
COUNTROWS(INTERSECT(__Table1, __Table))- douglas-verdum4 years agoNew Member
great Greg_Deckler
but this gives the aggregate value
could you come up with something that splits this number along the date filter context in a view?
there is a dimCalendar related to this fact table
thanks!
- Greg_Deckler4 years agoCommunity Champion
douglas-verdum So generally you would have a relationship between your date table and that table based on date and you would use Month or something like that from your date table in the axis of your visual. Also, if the = 4 part can be in any month, you would need a slight variation:
Measure = VAR __Table = DISTINCT(SELECTCOLUMNS(FILTER(ALL('Table'), [IdNatureza] = 4), "__Matricula", [Matricula])) VAR __Table1 = DISTINCT(SELECTCOLUMNS(FILTER('Table', [IdMotivo] = 1), "__Matricula", [Matricula])) RETURN COUNTROWS(INTERSECT(__Table1, __Table))- douglas-verdum4 years agoNew Member