cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
hrlope
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
Fowmy
Super User
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


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

2 REPLIES 2
Fowmy
Super User
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


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

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

Helpful resources

Announcements
Microsoft Build 768x460.png

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.

May 23 2022 epsiode 5 without aka link.jpg

The Power BI Community Show

Welcome to the Power BI Community Show! Jeroen ter Heerdt talks about the importance of Data Modeling.

Power BI Dev Camp Session 22 with aka link 768x460.jpg

Check it out!

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

charticulator_carousel_with_text (1).png

Charticulator Design Challenge

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