Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi!
I would like to create a measure that is able to count the number of Matriculas in which:
1. the IdMotivo is equal to 1 and
2. there is a IdNatureza equals to 4 whatever the date it occurs.
The measure should output in a given month, created by filter context, the number of IdMotivo = 1 in that month for which there was a IdNatureza = 4 no matter the date this last one occured.
thanks in advance
Solved! Go to Solution.
@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))
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!
@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))
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 44 | |
| 43 | |
| 38 | |
| 19 | |
| 15 |
| User | Count |
|---|---|
| 68 | |
| 64 | |
| 31 | |
| 29 | |
| 24 |