Forum Discussion

Faracla's avatar
Faracla
Frequent Visitor
3 years ago

Table measure total wrong

Dear BI community
I'm facing a problem with the total of a measure not being correct once I drop it in a table, I saw by doing research in the forum that is a common issue, but even though I checked multiple threads I could not find what is good for my case.

The measure that is giving me problems is Weigth share week, as you can see by the screenshot the total is wrong, should be 38.89

 

 



To get WeightShareWeek first I created a measure for WeightShareMeasure as per below:

VAR ValueToDivide = CALCULATE(SUMX(DIM_Tenders,DIM_Tenders[Accepted Loads]), ALLSELECTED(DIM_Tenders))/100

RETURN

[_Accepted_load]/ValueToDivide

 

Then I got the WeightShareRowW  measure as per below:
([WeightShareMeasure]*[___ShareFullWeek_update2])/100

Finally I calculated
WeightShareWeek is calculated like this=
var summarizedtable=

SUMMARIZE(DIM_Tenders,DIM_Loads[CarrierCode],DIM_Loads[CarrierName],DIM_Tenders[LaneCode],DIM_Loads[Mode],DIM_Tenders[LanePercent],DIM_Tenders[LaneRank],DIM_Tenders[LoadWeek*LaneNumber],"test",[WeightShareRowW])

return

IF(HASONEVALUE(DIM_Tenders[LoadWeek*LaneNumber]),[WeightShareRowW],SUMX(summarizedtable,[test]))


I ve tried to turn into a column but I got a memory error

I tried to SUMX using Values , but result was still not correct
Spent more than 4 hours tring to figure this out,hope someone can give me a hand

Greg_Deckler I saw one of your thread for this but even following it could not solve , perhpas i'm making a mistake somewhere that I can t figure out, your help would be appreciated

thnaks 
claudio

3 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    Faracla What I don't see in your formula is YearWeek in your SUMMARIZE. Basically, what you want to SUMMARIZE on are any text fields primarily. So, I think you could SUMMARIZE on whatever the blurred out column is if that is unique in the rows of your matrix. Remember, you can use CONCATENATEX to return the values in your SUMMARIZE table to check what is being returned.

  • Faracla's avatar
    Faracla
    Frequent Visitor

    hi Greg_Deckler  , thanks for your answer
    i have added year week to summarize, but the result I get is still the same
    the blur colum are carriercode and carriername, both are presents in summarize
    as for CONCATENATEX I honestly I did not understande how to use it in this case

    What else can I try to get this solved?
    thank you

    • Greg_Deckler's avatar
      Greg_Deckler
      Community Champion

      Faracla Try this:

       

      WeightShareWeek is calculated like this=
      var summarizedtable=
      
      SUMMARIZE(DIM_Tenders,DIM_Loads[CarrierName],"test",[WeightShareRowW])
      return
       CONCATENATEX(summarizedTable, [CarrierCode] & "|", & [test], ", ")
        //IF(HASONEVALUE(DIM_Tenders[LoadWeek*LaneNumber]),[WeightShareRowW],SUMX(summarizedtable,[test]))

       

      This will allow you to debug the table of values you are creating. I really think you should only need CarrierCode but I may be mistaken.

       

      If none of this helps, post sample source data that simulates the issue.