Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
jonnyA
Responsive Resident
Responsive Resident

Measure divided by # days worked (10.13.21)

Hello,

 

Hoping someone could help me on how to divide a Total divided by the amount of days a shift was worked.

 

In my table I have "# of Patients Per Shift" that displays the # of patients per shift per day with a total at the bottom of the table.  I'm trying to figure out a formula that will divide the total # of Patients Per Shift divided by the # of days a Provider was working on those days.

 

jonnyA_0-1634145269475.png

 

jonnyA_1-1634145540809.png

# of Patients Per Shift = CALCULATE(COUNT(vw_Test Dataset_Discharge_Dataset[Procedure_Code]))

 

3 ACCEPTED SOLUTIONS
v-eqin-msft
Community Support
Community Support

Hi @jonnyA ,

 

I have built a data sample:

Eyelyn9_0-1634607108438.png

 

According to your description, it seems that you want to change the total average rather than the each cell as shown below:

Eyelyn9_1-1634607703503.png

 

If so,please try:

Average=
VAR _totalAvg =
    DIVIDE (
        SUMX ( 'vw_Test Dataset_Discharge_Dataset', [# of Patients Per Shift] ),
        DISTINCTCOUNT ( 'vw_Test Dataset_Discharge_Dataset'[Shift Name] )
    )
RETURN
    IF (
        ISINSCOPE ( 'vw_Test Dataset_Discharge_Dataset'[Shift Name] ),
        [Your original Measure],
        _totalAvg
    )

 

Eyelyn9_2-1634607869626.png

 

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

jonnyA
Responsive Resident
Responsive Resident

 Thank you so much for your formula, high five!!!

 

I had to change Shift Name to DOS, so when I did that your formula worked!!!

 

Thank you so much for your time and effort and for providing the data sample, that helps a lot!!!

 

Trying to mark yours as solution, but do not have the option?

View solution in original post

jonnyA
Responsive Resident
Responsive Resident

4 REPLIES 4
jonnyA
Responsive Resident
Responsive Resident

 Thank you so much for your formula, high five!!!

 

I had to change Shift Name to DOS, so when I did that your formula worked!!!

 

Thank you so much for your time and effort and for providing the data sample, that helps a lot!!!

 

Trying to mark yours as solution, but do not have the option?

jonnyA
Responsive Resident
Responsive Resident

v-eqin-msft
Community Support
Community Support

Hi @jonnyA ,

 

I have built a data sample:

Eyelyn9_0-1634607108438.png

 

According to your description, it seems that you want to change the total average rather than the each cell as shown below:

Eyelyn9_1-1634607703503.png

 

If so,please try:

Average=
VAR _totalAvg =
    DIVIDE (
        SUMX ( 'vw_Test Dataset_Discharge_Dataset', [# of Patients Per Shift] ),
        DISTINCTCOUNT ( 'vw_Test Dataset_Discharge_Dataset'[Shift Name] )
    )
RETURN
    IF (
        ISINSCOPE ( 'vw_Test Dataset_Discharge_Dataset'[Shift Name] ),
        [Your original Measure],
        _totalAvg
    )

 

Eyelyn9_2-1634607869626.png

 

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

lbendlin
Super User
Super User

Please provide sanitized sample data that fully covers your issue. Paste the data into a table in your post or use one of the file services. Please show the expected outcome.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.