Forum Discussion

gvandalay's avatar
gvandalay
Regular Visitor
1 year ago
Solved

struggling with matrix aggregation results

for some reason my return quantity is showing incorrectly.

 

I have the return set as a measure, but when i put it in the matrix it shows incorrectly.  I am pretty new and cannot figure this out.   someone suggested to me that i might have the field set to display max value, but i do not even see that as an option.  any help you could give would be great.  was laid off and have a potential job opportunity, but i need to be able to demonstrate that i can handle powerbi.  wanted to attach the file but do not see an attach option.

 

 

 

  • no problem, your relationship between adventure works and the calendar is deactivated, its got a dotted line.  you need to double click on it and make it active.  that why the relattionship isn't working right now

8 Replies

  • abpgupta's avatar
    abpgupta
    Icon for Continued Contributor rankContinued Contributor

    While working with measures, you need to understand what's correct value to display for each context:
    1. Row Context ( what other fields involved)

    2. Filter Context ( outside filters)  

    Max etc function can be set inside measure calculation so you don't need option to change on UI.

    My suggestion is breakdown your problem logic using Table visual to arrive at correct result for given row context and then use performance analyzer to generate DAX for creating measure. 
     
     

  • vanessafvg's avatar
    vanessafvg
    Icon for Community Champion rankCommunity Champion

    are all these fields  from the same table?  have you explicitly written a measure?  whats the code for return?  or is it a column in a table

    • gvandalay's avatar
      gvandalay
      Regular Visitor

      i wrote a measure for this.   doesn't make sense.  here is the measure i wrote for the return

      return = sum('AdventureWorks Returns Data'[ReturnQuantity])
       
      and here is the measure i wrote for the order quantity
      Order Quantity =
      sum(
          'Sales Data'[OrderQuantity])
      • vanessafvg's avatar
        vanessafvg
        Icon for Community Champion rankCommunity Champion

        those are different tables and you can see there is no relationship between them because the number is the same on each row. you have to create a relationship to join them.

         

        you cannot join a transactional table to a transactional table unless you merge them but you need to know how to join them, what are the common fields between them?