Forum Discussion

CAMA_UK_18's avatar
CAMA_UK_18
Frequent Visitor
4 years ago
Solved

Help with DAX

I wonder if someone could spare some time to help me with writing a measure? It seems easy logically but I can't get it to work!

 

I've simplified the query onto excel: I have a Sales Table and a Facts Table (cost of logistics for each customer). I've linked the two tables via a one:many relationship from the Logistics Table to the Sales Table.

 

Using SUMX and Related, I've successfully written some simple dax (but not simple for me!) that returns the correct result in the matrix for sales x Logistics fee %. However, no matter what measure I try to write to pull in the fixed fee per customer, I get the total of all fixed fees on every line (highlighted red on the blue table):

 

How should my measure be written? It's driving me mad!

 

Thanks

 

  • I reworked my relationships and it works just fine now. Argh! Thanks for your help, though.

6 Replies

  • CAMA_UK_18's avatar
    CAMA_UK_18
    Frequent Visitor

    I reworked my relationships and it works just fine now. Argh! Thanks for your help, though.

  • TheoC's avatar
    TheoC
    Community Champion

    Hi CAMA_UK_18 

     

    I think your fields for Fixed Fee might be set to SUM.  On the Matrix visual, can you click the down arrow on the Fixed Fee column and select Don't Summarise or select Max?

     

    Hopefully this helps!

    Theo

    • CAMA_UK_18's avatar
      CAMA_UK_18
      Frequent Visitor

      Hi TheoC ! I don't see 'Don't summarise' and selecting 'Max' gives me the same value on each row still, albeit the max value rather than the total. It's as though the relationship isn't working, but if that was the case, I don't think my other measure would work either.