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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
S2861926
Regular Visitor

How to correlate more rows in the same table with unique ID

Hi,

in a table (SQL database) I have the double-entry bookkeeping (accounting movements) as shown in the attached figure:

Immagine 2021-11-15 150255.png

 

 

 

 

 

 

 

 

 

 

 

 

 

I want to correlate all the movements on the basis of the "registration ID" column (column A), in order to understand which customers have determined my revenues. I try to report another figure to make you understand what I mean:

Immagine 2021-11-15 150518.png

 

 

 

It's possible to to that with Power BI?

thx

 

6 REPLIES 6
v-shex-msft
Community Support
Community Support

HI @S2861926,

It seems like you want to use the customer code to register with all movements descriptions, then you can simply summary these records with specific customers.

If that is the case, I'd like to suggest you create a calculated column to loop records based on the current 'registration ID' group to find out the corresponding user to tag these records.

User =
CALCULATE (
    CONCATENATEX ( VALUES ( 'Table'[Description] ), [Description], "," ),
    FILTER (
        'Table',
        'Table'[Registration ID] = EARLIER ( 'Table'[registration ID] )
            && SEARCH ( "33.05.11", 'Table'[Account Code], 1, -1 ) > 0
    )
)

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
S2861926
Regular Visitor

I had thought about creating a "dimension table" but I would like a model that is always updated automatically ... let me explain.
If I create a pivot table with "Registration ID" and "Customer Name" it can be fine for the data I'm working on now, but tomorrow, for example by increasing the number of registrations (Reg.ID) or new customers (Customer Name) I should always recreate a new table to import into my "dimension table". I would like a system that automatically updates itself starting from the data contained in my SQL server ...
I had tried (with poor results)

So doesn't have to be static you can make a dynamic table ,a portion of your current query/table  , something like this:

 

Select Distict Registration ID, Customer Name,

from Table

;

 

 

sorry but i can't understand what you mean ... could you be more specific?

Hi @S2861926,

I mean you can add a calculated column to store the customer that extract from each registration ID group.

Then you can use this field to create a table visual with the above field and 'debit' and 'credit' fields.

For the displayed value type, you can add a filter with the 'description' field to control which one is displayed on the visual.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
NilR
Post Patron
Post Patron

I would create a dimension table with the Registration ID and Customer Name. Then Join on the back End or create relationship in the front end.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

November Carousel

Fabric Community Update - November 2024

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

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.