Forum Discussion

hoffsquig's avatar
hoffsquig
Regular Visitor
3 years ago

table value doesn't match card value for simple measure

Hey all.  this "issue" is driving me crazy.   I have a measure that contains an IF statement.  It is set to 0 or 1 depending if the measure meets a goal.  These rates are calculated by month with a relationship to an associated Date table based on a YearMonth column.  

 

AttritionGood = if('Devs'[AttritionRate] <= 'Devs'[AttritionGoal], 1, 0)

 

The AttritionRate is 22.6% and the AttritionGoal is 20%, so the measure correctly displays 0 in the card visual.  It calculates correctly as I use my slicer to select the other months.

 

HOWEVER, when I reference this measure in a table I created, in the "ATTGOOD" column, every row (month) shows 1, and doesn't match the card for the months where it's 0.  The weird part is, I've done the same measure for other metrics, and they calculate correctly in the table showing a 0 or 1 for the respective month (MCGood, TNMCMGood), while the Attrition measure, which as far as I can tell is exactly the same....always shows a 1 and doesnt match the card visual.  The only difference between the ones that are working, and this broken Attrition measure is different source tables.  But I double checked that the model relationships are the same to the date table as well.  Why doesn't it match the card?!  I've clearly missed something.  Any ideas?

 

 

3 Replies

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

    It will be a context issue.  Measures are evaluated according to context.  I can't tell from the provided information how these measures are being used but this "HOWEVER, when I reference this measure in a table I created, in the "ATTGOOD" column" sounds like a measure is being used in a calculated table. This is not good.

    So you will have to look at this a different way. 

    -

    Also, by convention, we refer to measures without the base table.

    And please don't use measures in calculated columns, use them in visuals.

    • hoffsquig's avatar
      hoffsquig
      Regular Visitor

      So, I guess I dont know how to accomplish this.  The real issue is that my time series line chart doesn't match the Gauge.  The gauge is based on a measure

      FleetHealthRating = (MCGood + AttritionGood + TNMCMGood) / 3.

      I place the same FleetHealthRating measure in a line chart, and the monthly values (context?) dont match.  I dont understand context all too well, but it feels like the two should at least match, even if they're wrong overall.

      I thought the table in the question would above help me work around it, but I'll abandon that idea.   See below.

       

       

      • hoffsquig's avatar
        hoffsquig
        Regular Visitor

        it's clearly all context issues on some of my measures.  I'll double check them all.  I probably didn't use the calculate function correctly