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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Average over SUMX

I cannot seem to get the desired average I want. The average function is giving too much weight to the group with 4 different coverage types. I'm combining this with my second question because these counts below are summed over multiple records as there are corrections often made in different close dates, which you can see in the data in the second file.

Census average.jpg

 

I also want to create the custom bins over these summed census totals over all close dates.

Custom Bin.jpg

 

Thanks in advance!

Lorena

1 ACCEPTED SOLUTION

hi @Anonymous 

You could use this two formula to get the custom bins:

Census to Bin = CALCULATE(SUM('FactPremium'[Census Total]),ALLEXCEPT('FactPremium','FactPremium'[Group Name],'FactPremium'[Coverage Type],'FactPremium'[Coverage Date]))
Desired Bin = IF(FactPremium[Census to Bin]<=1,"",
IF(FactPremium[Census to Bin]<=14,"2-14",
IF(FactPremium[Census to Bin]<=24,"15-24",
IF(FactPremium[Census to Bin]<=99,"25-99",
IF(FactPremium[Census to Bin]<=499,"100-499",
IF(FactPremium[Census to Bin]<=999,"500-999",
"1000+"))))))

and here is sample pbix file, please try it.

 

Regards,

Lin

Community Support Team _ Lin
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

8 REPLIES 8
v-lili6-msft
Community Support
Community Support

hi @Anonymous 

Please share your sample pbix file for us have a test, it will be a great help.

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Ashish_Mathur
Super User
Super User

Hi,

Your question is not clear.  Explain the business question, share some data and also show the expected result in MS Excel.  Also, share the link from where i can download your file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

My apologies, as I am new to this forum, but I did not see where I could attach a file, which is why I just posted the screen shots. Would you know how I could do this?

Hi,

Upload the workbook to Google Drive and share the download link.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

I appreciate you taking the time to look, but I was able to solve the problem by using the following:
AVERAGEX(
    KEEPFILTERS(
        CROSSJOIN(
            VALUES(FactPremium[Group Name]),
            VALUES(FactPremium[Coverage Date])
        )
    ),
    [Census Total Average]
)

Anonymous
Not applicable

I'm still having the issue with the custom bins.


Below shows my desired result:
https://drive.google.com/open?id=1byb6ubhpSlrjJ3XYHIeBwI2USOSMCGZz

Below is the sample pbix:
https://drive.google.com/open?id=1YHFSIEb-xEmKCUUe6YMy2tZ8CqkgiIJR

hi @Anonymous 

You could use this two formula to get the custom bins:

Census to Bin = CALCULATE(SUM('FactPremium'[Census Total]),ALLEXCEPT('FactPremium','FactPremium'[Group Name],'FactPremium'[Coverage Type],'FactPremium'[Coverage Date]))
Desired Bin = IF(FactPremium[Census to Bin]<=1,"",
IF(FactPremium[Census to Bin]<=14,"2-14",
IF(FactPremium[Census to Bin]<=24,"15-24",
IF(FactPremium[Census to Bin]<=99,"25-99",
IF(FactPremium[Census to Bin]<=499,"100-499",
IF(FactPremium[Census to Bin]<=999,"500-999",
"1000+"))))))

and here is sample pbix file, please try it.

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

This worked! Thank you!

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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