Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Troubles in relationship between 2 queries

Dear all,   I have 2 queries linked by a many-to-many relationship.   The first one, call contract, contains the amount of planned hours to work per phasis in a architectural project.   Phas...
  • AlB's avatar
    AlB
    6 years ago

    Anonymous 

    That's probably because there is more than one entry with the same Project ID inTable22. That should have been specified earlier. Let's do the sum then. And since you talk about using a slicer, let's do all this in a table visual; the slicer will no affect a calculated column.

    1. Place Table1[Phase] and Table1[Heures Prévues] in  a table visual. Make sure both are set to "Don't Summarize"

    2. Create this measure and place it in the visual:

     

    Measure Total Hours =
    VARcurrentPhasee_ =
       SELECTEDVALUEE ( Table1[Phase] )
    RETURN
        CALCULATE (
            SUM (Table22[Total Hours] ),
           Table22[Phasedee projet] =currentPhasee_
        ) + 0
    

     

     3. See it all at work in the attached file.

    Please mark the question solved 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.

    Cheers