Forum Discussion

sabeensp's avatar
sabeensp
Icon for Helper IV rankHelper IV
7 years ago
Solved

Constant Calculated measure value with slicer interaction

Hello,

I have a report with bunch of slicers, however all teh slicers value are pinned to same table "Model". I have craeted a Measure as below:

MeasureName = 
var vNum = CALCULATE (COUNT(TABLE1[COST] , Filter (Table1, Table1[Color] = "Blue") // This is Numerator

var vDen = CALCULATE (SUM(TABLE1[REVENUE] , Filter (Table1, Table1[Year] = 2019) , ALL (TABLE1)
// This is Denominator

RETURN

vNum / vDen

 

But When user selects the value in Solicer Denominator also changes, I want Denominator to stay constant.

 

Please help.

  • Jorgast's avatar
    Jorgast
    7 years ago

    sabeensp 

     

     

    I belive what Anonymous is referring to is this code:

    var vDen = CALCULATE (SUM(TABLE1[REVENUE] , Filter (Table1, Table1[Year] = 2019) , ALL('Table'[Column])

     

    If this works for you, please accept Anonymous  post.

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    sabeensp - You want to ignore the filter on a certain column. In other words, modify the natural filter context. To do this, you add an ALL('Table'[Column]) as a new parameter in your CALCULATE.

    Hope this helps,

    Nathan

    • sabeensp's avatar
      sabeensp
      Icon for Helper IV rankHelper IV

      Anonymous  Sorry, I'm new to DAX. COuld you please furher elobrate or give me the syntax?

      • Jorgast's avatar
        Jorgast
        Icon for Resolver II rankResolver II

        sabeensp 

         

         

        I belive what Anonymous is referring to is this code:

        var vDen = CALCULATE (SUM(TABLE1[REVENUE] , Filter (Table1, Table1[Year] = 2019) , ALL('Table'[Column])

         

        If this works for you, please accept Anonymous  post.