Forum Discussion

Cedbont's avatar
Cedbont
Regular Visitor
2 years ago
Solved

In a visual, get table values updated with another table value

Hi there!

 

I have got PBIX file that features a table indicating:

 - Training courses (courses A, B, C...)

 - For each training course, there can be several training sessions (with start and end dates, location...: sessions A1, A2..., B1, B2..., C1, C2...)

 - And the price of one seat in a training session.

 

The price depends on the training course (A, B, C...) and on the type of client (inhouse or external).

 

So for session A1, we get 2 prices depending the client type. Same principle and same prices for session A2. Same principle but potentially different prices for session B1 (course A is different to course B). Etc.

 

My PBIX file also features a slicer that helps filtering the above-described table with the client type. Indeed, I want to display only the training courses (hundreds), hence sessions (thousands), dates... that fit the type of client I selected in the slicer. This works perfectly fine.

 

Here is an example:

 

Here are also the links between the tables that feed the model (in this image, code means training course code):

 

My trouble is: how to display in my visual, in my table, the price of each course that changes with the type of client that I select?

 

What I tried:

 - Add a calculated column in the 3 - Price

 - Calculcate in this new column the price for external clients based on the already available column of the price for the inhouse clients

 

What I would have liked to work (that did not work, of course...):

 - Display in the table (visual) the correct price depending on the course and the type of client that I selected in the slicer.

 

Would anyone have a clue on how to have the correct price displayed in the last column of my table?

 

Thanks a lot for your able (I am just a beginner)

 

Cedbont

  • Hi all,

     

    I have found a workaround. I would appreciate if you told me this was the best way or not.

     

    Instead of having a link between tables 1-Sessions and 3-Prix (prices), I:

    • Deleted that link
    • Created a new one between 2-Clients and 3-Prix (prices)
    • Created a new price thanks to a new calculated column in 2-Clients that could use as arguments both the reference price located in 3-Prix and the client type located in 2-Clients
    • Called that new price in my table (visual).

     

    Cedbont

1 Reply

  • Cedbont's avatar
    Cedbont
    Regular Visitor

    Hi all,

     

    I have found a workaround. I would appreciate if you told me this was the best way or not.

     

    Instead of having a link between tables 1-Sessions and 3-Prix (prices), I:

    • Deleted that link
    • Created a new one between 2-Clients and 3-Prix (prices)
    • Created a new price thanks to a new calculated column in 2-Clients that could use as arguments both the reference price located in 3-Prix and the client type located in 2-Clients
    • Called that new price in my table (visual).

     

    Cedbont