cancel
Showing results for
Did you mean:
coreyweiss Member

## Total of Measure Incorrect

Hello,

I have this table, but the total is wrong (its missing the 120 +120 to equal 3205 for Tax Place holder and 2592 for Cash Place holder)

My measures are:

Tax Place Holder = IF(ISBLANK(SUM('Pi Data'[Taxes])),5*24,SUM('Pi Data'[Taxes]))

and

Cash Place Holder = 18*24.

Note: [Cash Place Holder] is just for showing what the problem is. It seems that it should be like SUM(18*24)

My objective is to have [Tax Place Holder] have the correct total. Whenever there is not a value for that day, it is to insert 5*24.

Here is my data:

 Date Taxes 10/2/2016 0:00 635.802 10/3/2016 0:00 649.527 10/6/2016 0:00 827.314 10/4/2016 0:00 852.5352

Note that 9/30 and 10/1 do not exist in my table with taxes, but the place holder would have values for these dates from a calendar table.

Any thoughts?

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions Community Support Team

## Re: Total of Measure Incorrect

create measures

```blank_flag = IF(SUM('Pi Data'[Taxes])=BLANK(),1,0)

Tax Place Holder2 =
VAR count_blank =
COUNTX ( FILTER ( ALLSELECTED ( 'date' ), [blank_flag] = 1 ), [blank_flag] )
VAR tax1 =
IF ( ISBLANK ( SUM ( 'Pi Data'[Taxes] ) ), 5 * 24, SUM ( 'Pi Data'[Taxes] ) )
RETURN
IF (
HASONEVALUE ( 'date'[Date] ),
tax1,
CALCULATE ( SUM ( 'Pi Data'[Taxes] ), ALLSELECTED ( 'date'[Date] ) )
+ 120 * count_blank
)

Cash Place Holder2 = var sum1=18*24 return IF(HASONEVALUE('date'[Date]),sum1,SUMX(ALLSELECTED('date'),sum1))
``` Best Regards

Maggie

2 REPLIES 2 Community Support Team

## Re: Total of Measure Incorrect

create measures

```blank_flag = IF(SUM('Pi Data'[Taxes])=BLANK(),1,0)

Tax Place Holder2 =
VAR count_blank =
COUNTX ( FILTER ( ALLSELECTED ( 'date' ), [blank_flag] = 1 ), [blank_flag] )
VAR tax1 =
IF ( ISBLANK ( SUM ( 'Pi Data'[Taxes] ) ), 5 * 24, SUM ( 'Pi Data'[Taxes] ) )
RETURN
IF (
HASONEVALUE ( 'date'[Date] ),
tax1,
CALCULATE ( SUM ( 'Pi Data'[Taxes] ), ALLSELECTED ( 'date'[Date] ) )
+ 120 * count_blank
)

Cash Place Holder2 = var sum1=18*24 return IF(HASONEVALUE('date'[Date]),sum1,SUMX(ALLSELECTED('date'),sum1))
``` Best Regards

Maggie

coreyweiss Member

## Re: Total of Measure Incorrect

Thanks! it works. Crazy that it needs to be that complicated haha!!

Announcements #### Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system. #### January 2020 Community Highlights

Make sure you didn't miss any of the things that happened in the community in January! Top Solution Authors
Top Kudoed Authors
Users online (3,651)