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

Sum the # of Days Selected

Note: I have a "Date_of_Service" slicer that has 9/7/2021 through 9/14/2021 selected.

 

I am hoping someone could help me how to figure out how to Count the # of Days Selected?  Instead of 8, it should be 112.

 

The main goal I am trying to accomplish is figure out a formula that takes the sum of the "Count Distinct Visits" divided by "# of Days Selected" which will give me the true average.  If you see my attached image I am trying to get the 17.25.  But Power BI shows 8.05.  i cant figure out how to create the formula to get me the 17.25?

 

Thanks,

 

jonnyA_0-1658763564770.png

 

 

1 ACCEPTED SOLUTION

Hi @jonnyA ,

 

Please try this measure:

Visits / Providers divided by # of Days selected =
VAR _s =
    SUMMARIZE (
        'Dataset_Extended_BillingTool',
        [Provider Name],
        "visits", [Visits / Providers],
        "of days selected", DISTINCTCOUNT ( 'Dataset_Extended_BillingTool'[Date_of_Service] )
    )
RETURN
    DIVIDE ( SUMX ( _s, [visits] ), SUMX ( _s, [of days selected] ) )

 

Best Regards

Community Support Team _ chenwu zhu

 

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

6 REPLIES 6
jonnyA
Responsive Resident
Responsive Resident

@v-chenwuz-msft 

That worked thank you so much!

jonnyA
Responsive Resident
Responsive Resident

Do you know why my screenshots vanish?

jonnyA
Responsive Resident
Responsive Resident

@amitchandak 

Did my reply help?

Also, my screenshots i added on this thread are not visible.

jonnyA
Responsive Resident
Responsive Resident

@amitchandak ,

I cannot share a sample report.

 

Does the attached screenshot help with what I am trying to accomplish?

 

jonnyA_0-1658781007981.png

 

Visits / Providers divided by # of Days selected =
DIVIDE(
    [Visits / Providers],
    DISTINCTCOUNT('Dataset_Extended_BillingTool'[Date_of_Service])
)

 

 

 

Hi @jonnyA ,

 

Please try this measure:

Visits / Providers divided by # of Days selected =
VAR _s =
    SUMMARIZE (
        'Dataset_Extended_BillingTool',
        [Provider Name],
        "visits", [Visits / Providers],
        "of days selected", DISTINCTCOUNT ( 'Dataset_Extended_BillingTool'[Date_of_Service] )
    )
RETURN
    DIVIDE ( SUMX ( _s, [visits] ), SUMX ( _s, [of days selected] ) )

 

Best Regards

Community Support Team _ chenwu zhu

 

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

amitchandak
Super User
Super User

@jonnyA , Can you share the measure calculation?


Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

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.