DAX Measure works, but totals don't when using an IF Statement

thedesk

New Member
Joined
Feb 16, 2021
Messages
3
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Hi there,

i am new to PowerPivot and DAX, but am managing to set up DAX Measures and they work, apart from where it is filtered out with IF statements, whereby it is returning the correct value in the measure but the totals do not match this.

My DAX for this column is.... All of the [] are existing measures.


=if([Total Samples]>0,

if([KPI Target]>[TAT Achieved %],

[Sum of Total Cost]*.03),"")
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
To understand what is going on, you should add the measures that are part of the IF statement directly into the pivot table and look at the value they return at the total level. When in the pivot, they are filtered by the rows of the pivot. When they are at the total level, there is no filtering, hence the aggregates may not do what you want. the solution depends on what you want.
 
Upvote 0
There IF statement is based on the total row grouping and if they have reached the target or not. It can not be based on each line within the table as at this stage we can’t tell if they have reached the target.

although the measure works perfectly on each line in the pivot table, the totals is applying the IF statement to the totals aswell instead of returning the sum based on the column.
 
Upvote 0

Forum statistics

Threads
1,214,813
Messages
6,121,706
Members
449,048
Latest member
81jamesacct

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top