Forum Discussion

cshashank's avatar
cshashank
Frequent Visitor
9 years ago
Solved

Need Help with Dax

Hi, I have a below table

 

DateTest NameUnique Cases Executed Pass
13-Jul-17Cup155
14-Jul-17Cup2010
15-Jul-17Tea224
16-Jul-17Cup4030
17-Jul-17Cup1211

 

 

I want to create a report, where Pass% always shows Sum of all 'Unique Cases Executed' irrespective what date is selected.

 

Currently, if I apply date filter, the pass% changes based on 'Unique Cases Executed' between selected date range. How can I calculate static 'Unique Cases Executed'? Any help is appreciated. Sample of PowerBI report link: https://app.powerbi.com/view?r=eyJrIjoiZDIzNTViNmMtNjk0YS00YWZiLWE1ZDctYzNkN2Q3OWNlNDFhIiwidCI6IjhmM2UzNmVhLTgwMzktNGI0MC04MWE3LTdkYzA1OTllODY0NSIsImMiOjF9

  • Hey,

     

    Basically you can achieve what you on two ways:

     

    • change the interaction between the time slicer and your kpi visual
    • calculate a independent measure like this
      mspassindependent = calculate(
      sum('tablename'[measurename],
      all('tablename'[nameofthedatecolumn])
      )
  • Please provide the numbers you want to use to calculate the kpi and the result you expect

  • kcantor's avatar
    kcantor
    9 years ago

    Wrap it in calculate and remove the date filter for total unique cases executed.

    Total Unique Cases Executed = CALCULATE([Unique Cases Executed], ALL('Date'[Date]))

    That removes the date filter. If you need to reapply the date filter to maintain a certain year or month you can add that back in calculate.

     Then use the Total Unique Cases Executed to calculate your percentage instead.

    You will need a date table. I am assuming you have one and it is called Date in my measure example.

6 Replies

  • Hey,

     

    Basically you can achieve what you on two ways:

     

    • change the interaction between the time slicer and your kpi visual
    • calculate a independent measure like this
      mspassindependent = calculate(
      sum('tablename'[measurename],
      all('tablename'[nameofthedatecolumn])
      )
    • cshashank's avatar
      cshashank
      Frequent Visitor

      Thanks Tom for quick reply.

       

      Changing interaction between the time slicer and kpi visual will not work, because I need the sum of 'UniqueCasesExecuted' 

       

      Tried with DAX you mentioned, but its giving me same result 

      • TomMartens's avatar
        TomMartens
        Super User

        Please provide the numbers you want to use to calculate the kpi and the result you expect