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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
MrSujay
Resolver II
Resolver II

3 TABLE - Many to one and one to many relationship and match row by row from another table


There are 3 tables Score, Class, and point.
please check the data and relationship in the below screenshots.
I am trying this on huge data.

Note:   1. I can't change the relationship among tables.

            2. I can't create another table using the merge query.

            3. I have to add measure/column into table point which refers value from table Score.


Please let me know how I can achieve this using the DAX query.
I cant use the Merge query I think if I add measure into the table Points table visual will show data.
OR suppose if I add an index column in the score and point table then how i can join it in the DAX query?

MrSujay_1-1654026223590.png
In expected output, score is sorted in asc order with partition by Class.
Also, I got the below error while showing it on the table visual.

MrSujay_2-1654026517075.png

 

 

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

Hi @MrSujay ,

 

Please refer this formula:

m_score =
CALCULATE (
    SUM ( score[score] ),
    FILTER ( ALLSELECTED ( score ), score[index] = SELECTEDVALUE ( point[index] ) )
)

vjaywmsft_0-1654507490083.png

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

3 REPLIES 3
v-jayw-msft
Community Support
Community Support

Hi @MrSujay ,

 

Please refer this formula:

m_score =
CALCULATE (
    SUM ( score[score] ),
    FILTER ( ALLSELECTED ( score ), score[index] = SELECTEDVALUE ( point[index] ) )
)

vjaywmsft_0-1654507490083.png

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
amitchandak
Super User
Super User

@MrSujay , You can not have un-summarized columns from both Many size tables.

 

data has to group by common view bys. So add some index inside class to get that

 

a  new column in table

Rank= Rankx(filter(Table, [Class] = earlier([class]) , [point],,asc,dense)

 

Rank= Rankx(filter(Table, [Class] = earlier([class]) , [score],,asc,dense)

 

 

Now have a common table like

 

Rank = generateseries(1,10,1)

 

Join with both tables on rank and use this also as a common column in visual

Not working with rank . but i have added one index column in both point and score table then how to join it ?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.