Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
aze
New Member

Related is not working for some reason...

Hello, for some reason related measure is not working and I'm out of ideas why.

I have this formula, which supposes to work:

aze_0-1617470555637.png

Keyword_2_profitability = ('Keywords statistika'[Weight]) * RELATED('Nuotraukų pardavimai'[Earnings])
 
Table 'Nuotraukų pardavimai'[Earnings] has unique values. It has 1 to many relationship:
aze_1-1617470702531.png

What else might be wrong?

 

1 ACCEPTED SOLUTION
v-lionel-msft
Community Support
Community Support

Hi @aze ,

 

Please refer to my .pbix file, which may help you.

v-lionel-msft_1-1617769152709.pngv-lionel-msft_2-1617769167520.png

v-lionel-msft_3-1617769179327.png

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
v-lionel-msft
Community Support
Community Support

Hi @aze ,

 

Please refer to my .pbix file, which may help you.

v-lionel-msft_1-1617769152709.pngv-lionel-msft_2-1617769167520.png

v-lionel-msft_3-1617769179327.png

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

AlB
Super User
Super User

@aze 

Can you share the pbix? If necessary with mock data but reproducing the issue

Try this in the meantime:

1. Set the relationship cross filter direction to SINGLE. Setting it as Both is asking for trouble unless you know very well what you are doing.

2. 

Keyword_2_profitability  V2 =
SUMX (
    'Keywords statistika',
    'Keywords statistika'[Weight] * RELATED ( 'Nuotraukų pardavimai'[Earnings] )
)

 

SU18_powerbi_badge

Please accept the solution when done and consider giving a thumbs up if posts are helpful. 

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

 

aze
New Member

Also, than I did measure like this


Keyword_profitability = SUM('Keywords statistika'[Weight]) * SUM('Nuotraukų pardavimai'[Earnings])

aze_0-1617541500447.png

 


I got something, but calculation was not correct.

In this table individual calculation is good, but Totals is not. And that's obviuos, because formula sums everything and only then multiplies. And I need just individual rows to be multiplied, so I could use this measure in charts where I can't add the titles or ID's (like in this table)

 

AlB
Super User
Super User

Hi @aze 

RELATED needs row context. You do not have it in a measure. You'll need to do some sort of aggregation.Wat exactly are you trying to do? If you show an example it will help clarify

 

SU18_powerbi_badge

Please accept the solution when done and consider giving a thumbs up if posts are helpful. 

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

 

Each Keyword has some kind of weight. In the other table, there is the list of unique names (connected by ID) which has an Earnings column. So I want to multiply Weight * Earnings. So that each line in "Keywords statistika" table would have this new number.

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.