cancel
Showing results for
Did you mean:
New Member

## DAX for addition and division

I want to ADD Append1,[Time Off(Hours)] to Append1[Hours Reported] prior to the division. Any suggestions?

VAR _HoursReported = Calculate(SUM(Append1[Hours Reported]),FILTER(Append1, Month(Append1[Reported Date]) = 10))
Var _TicketCount = Calculate(DISTINCTCOUNT(Append1[Number]),FILTER(Append1,Append1[Assignment group] IN {"DC - US - DDC - Hardware","DC - US - EDC - Hardware","DC - US - Impl and Maint DNG/EGV","DC - US - Planners" } && Month(Append1[Created] ) = 10 ))
RETURN
DIVIDE(_HoursReported,_TicketCount,0)

1 ACCEPTED SOLUTION
Super User

@hrlope

I am not sure how your datamodel is setup but please try the following measure:

``````VAR _TimeOff =
CALCULATE (
SUM ( Append1[Time Off(Hours)]),
FILTER ( Append1, MONTH ( Append1[Reported Date] ) = 10 )
)
VAR _HoursReported =
CALCULATE (
SUM ( Append1[Hours Reported] ),
FILTER ( Append1, MONTH ( Append1[Reported Date] ) = 10 )
)
VAR _TicketCount =
CALCULATE (
DISTINCTCOUNT ( Append1[Number] ),
FILTER (
Append1,
Append1[Assignment group]
IN {
"DC - US - DDC - Hardware",
"DC - US - EDC - Hardware",
"DC - US - Impl and Maint DNG/EGV",
"DC - US - Planners"
}
&& MONTH ( Append1[Created] ) = 10
)
)
RETURN
DIVIDE ( _HoursReported  + _TimeOff, _TicketCount, 0 )
``````

Did I answer your question? Mark my post as a solution! and hit thumbs up
2 REPLIES 2
Super User

@hrlope

I am not sure how your datamodel is setup but please try the following measure:

``````VAR _TimeOff =
CALCULATE (
SUM ( Append1[Time Off(Hours)]),
FILTER ( Append1, MONTH ( Append1[Reported Date] ) = 10 )
)
VAR _HoursReported =
CALCULATE (
SUM ( Append1[Hours Reported] ),
FILTER ( Append1, MONTH ( Append1[Reported Date] ) = 10 )
)
VAR _TicketCount =
CALCULATE (
DISTINCTCOUNT ( Append1[Number] ),
FILTER (
Append1,
Append1[Assignment group]
IN {
"DC - US - DDC - Hardware",
"DC - US - EDC - Hardware",
"DC - US - Impl and Maint DNG/EGV",
"DC - US - Planners"
}
&& MONTH ( Append1[Created] ) = 10
)
)
RETURN
DIVIDE ( _HoursReported  + _TimeOff, _TicketCount, 0 )
``````

Did I answer your question? Mark my post as a solution! and hit thumbs up
New Member

Fowmy, This worked wonderfully. Thank you ever so much...

Announcements

#### Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

#### Charticulator Design Challenge

Put your data visualization and design skills to the test! This exciting challenge is happening now through May 31st!

#### What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

#### Check it out!

Mark your calendars and join us on Thursday, May 26 at 11a PDT for a great session with Ted Pattison!

Top Solution Authors
Top Kudoed Authors