Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
cshashank
Frequent Visitor

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=eyJrIjoiZDIzNTViNmMtNjk0YS00YWZiLWE1ZDctYzNkN2Q3OWNlNDFhIiwidCI6IjhmM...

3 ACCEPTED SOLUTIONS
TomMartens
Super User
Super User

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])
    )


Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

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



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

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.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

6 REPLIES 6
TomMartens
Super User
Super User

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])
    )


Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

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 

Capture.PNG

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



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

 

Capture2.PNGIn the above pic.. Last column ( yellow ) gives us Pass Percentage..

 

79% is coming because it calculates = 41 (pass) / 52 (Unique Cases Executed ) - both in blue

 

But the expected value is :

37%  based on calculation 41(Pass) / 109 (Total Cases Executed ).

 

 

 

 

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.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Thanks Kcantor,  TomMartens for the solution.

 

The mistake I did while trying TomMartens solutions was to use Sheet1[Date].[Date] instead of Sheet1[Date]

 

Thank you for your time.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.