Forum Discussion
Segmentations are not working
- 2 years ago
Hey RikiiGaitan ,
There are a couple of ways to optimize the semantic model. For example, height is information that belongs to the athlete table and not to a separate table. The same should be true for weight, except you want to analyze an athlete's performance dependent on the weight measured during the different events.
I would also suggest that you add the medal (bronze, silver, gold, or null to the Olympics_Athlete table, otherwise it's not clear when an anthlete won a medal.
Nevertheless, this is how the model looks like (see the layout page "simplified") i used to create a measure that reflects on selections in calendar table:
The measure looks like this:
# of medals = CALCULATE( COUNT( 'Athlete_Medal'[ID_Medal] ) , CROSSFILTER( Athlete[ID_Athlete] , Olympics_Athlete[ID_Athlete] , Both) ,CROSSFILTER( 'Medalla'[ID_Medal] , 'Athlete_Medal'[ID_Medal] , Both) )The table on the right is "dependent" on the selected yeaars:
Here you will find my pbix: https://tommartens-my.sharepoint.com/:u:/g/personal/tom_minceddata_com/EdUUlw6aqoRGgC6mBZ5rgwoB93bZ2A9ULDBpn_C9rWf9zQ?e=gJVdkH
The problem is that the measure did not consider the Calendar table: it is not directly related. I also had to use CROSSFILTER to change the filtering from the many sides of a relationship to the one side of a relationship.
I used CROSSFILTER for doing this. In general, it is considered best practice to use CROSSFILTER for changing the filter direction of a relationship, than enabling cross filter direction in the model.Hopefully, this provides what you are looking for.
Regards,
Tom
Hey RikiiGaitan ,
I'm not able to follow, I have difficulties to identify the date and event table in the model view.
Consider sharing the pbix, upload the pbix to OneDrive, Google Drive, or Dropbox and share the link.
Regards,
Tom
Hi TomMartens, thanks for answering. Sure i'll share the pbix file. You might notice it's a little bit different from the pictures, thats because i translated all the fields to english. In the pictures some of them were in Spanish.
Greetings,
Riki