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
Tlotly
Resolver II
Resolver II

Index match

Good day 

 

I have a dataset (table1) where the Commission is calculated by matching NR of Groups and Groups in Arrears in table 2 . NR of Groups in table 2 is highlighted in Blue and Groups in Arrears is highlighted in Green, values are Commission.

 

Since I'm automating the report into Power BI, I need to replicate the dataset and the formula but I'm struggling to organise the dataset to enble me to do proper PBI calculations.

 

This is the Excel formula used to achieve this: Scheme is table 2 in this post.  

=IF(OR(F10>13,E10<18),0,INDEX(Scheme!$C$39:$DU$53,MATCH(F10,Scheme!$B$39:$B$53,0),MATCH(E10,Scheme!$C$38:$DU$38,0)))

To explain the formula in simple terms. If NR of Groups  = 18 and Groups in Arrears = 1 then Commission will be  R139 etc..

 

The tables below are just snapshots, they are longer hence the formula has cells up to DU38.

 

table1

Tlotly_0-1666860046897.png

 

table 2 

Tlotly_1-1666860075087.png

 

Any idea on how to go about this?

Thank you

1 ACCEPTED SOLUTION

@Bifinity_75  thank you. Because Arrears and NR of Groups are two standalone tables, I joined them on SQL table then bought in as Groups_Arrears table. I then joined the table to the Commission's one through the key, as suggested (see below). 

Tlotly_0-1667810750984.png

So now I'm able to create a table visual as below, which is excellent. Thank you for your help.

Tlotly_1-1667810974289.png

 

 

View solution in original post

4 REPLIES 4
Bifinity_75
Solution Sage
Solution Sage

Hi @Tlotly , try this:

 

1.- In Table 2, select the first column like the image, and select  Unpivot other columns:

Bifinity_75_0-1666972612909.png

2.- Go to Relationship, and create this 2 relationship like the image:

Bifinity_75_1-1666972690918.png

 

3.- Result

Bifinity_75_2-1666972810789.png

I forgot to write 49 to value 3...

 

I hope you it works for you,

 

Best regards

 

Bifinity_75
Solution Sage
Solution Sage

Hi Totluy, follow this steps:

 

1- Add a Custon Column to concatenate NR of Groups and Groups in Arrears

Bifinity_75_0-1666871485810.png

 

2- Go to Table 2, select the first column, and unpivot other columns:

Bifinity_75_1-1666871755806.png

3- In the Table 2 concatenate NR + GROUP

Bifinity_75_2-1666871811549.png

4- In Relationship link NR+Groups of the Table 1 with NR+ Groups of the Table 2

Bifinity_75_3-1666871912315.png

5- Create measure: 

Bifinity_75_4-1666871953356.png

6- Result

Bifinity_75_5-1666871973342.png

 

Best regards

@Bifinity_75  thank you. Because Arrears and NR of Groups are two standalone tables, I joined them on SQL table then bought in as Groups_Arrears table. I then joined the table to the Commission's one through the key, as suggested (see below). 

Tlotly_0-1667810750984.png

So now I'm able to create a table visual as below, which is excellent. Thank you for your help.

Tlotly_1-1667810974289.png

 

 

Thank you very much @Bifinity_75 .

Your solution worked perfectly for organising my data. The only problem is I cannot concatenate table 1 as NR of Groups come from a different table to Groups in Arrears. 

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.