cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Kryssy
Helper II
Helper II

Dax Formula Not adding up with filter

Hello Power BI Community,

I have an issue with a DAX formula:

Basically, I want to have a target # of hours per month that is fixed by 105,  so I divided 105 by # of Days in a month.

Then, I multiply the # of days of each month a person works to find their target each month.

 

However, when I select on my filter all months this is not working here is what happens:

Kryssy_2-1649727639886.png

 

Formula = # of Days Worked * # of Hours Per Day

 

So, in the column Target Hours its totaling 210 instead of 207 because its multiplying 3.5 by 60. Is there a way around this so that it wont multiply by the 3.5 and add up instead to 207? 

 

If anyone can help me please?

1 ACCEPTED SOLUTION

@Kryssy 
No. I am referencing [Target] as measure. Please try and let me know the results

View solution in original post

6 REPLIES 6
Kryssy
Helper II
Helper II

SORRY, I didnt understand before and thank you so much for being patient with me. It works and THANK YOU SO MUCH!!!!!!

Kryssy
Helper II
Helper II

Hi Tamerj1, those are all dax formulas not columns, so I cant use those formulas. Atleast, I dont think I can, cause I tried Target is not a column its a formula

@Kryssy 
I know that. I was talking about the Provider ID and the Month columns. You may try the formula I've propose (Most prpobaly the 2nd one) and let me know how it goes. Thank you

tamerj1
Super User
Super User

HI @Kryssy 
The names of columns and tables and the relationships are not clear to me. However you may try 

 

Target New =
SUMX ( SUMMARIZE ( 'Table', 'Table'[Provider ID], 'Date'[Month] ), [Target] )

or

Target New =
SUMX (
    CROSSJOIN ( VALUES ( 'Table'[Provider ID] ), VALUES ( 'Date'[Month] ) ),
    [Target]
)

 

Hi Tamerj1,

In the formula you provided it references [Target} as a column, however I am unable to do that because its not a column its a DAX formula. I did try to use it but it didnt work. Sorry, maybe I am not understanding it properly? Is it referring to a column [Target} because if I try to put a measure in it, it does not accept it only a column. 

@Kryssy 
No. I am referencing [Target] as measure. Please try and let me know the results

Helpful resources

Announcements
Vote for T-Shirt Design

Power BI T-Shirt Design Challenge 2023

Vote for your favorite t-shirt design now through March 28.

March 2023 Update3

Power BI March 2023 Update

Find out more about the March 2023 update.

March Events 2023A

March 2023 Events

Find out more about the online and in person events happening in March!