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
herwet
Frequent Visitor

DIVIDE SUM based on chosen months

Hi, 

 

I am making i Workforce report. Those I create the report for want to look at the average of the workforce based on the number of selected months (divide the workforce sum by the number of selected months in the dashboard). In other words, if months 1, 2 and 3 are chosen, the workforce must be divided into 3. If months 4,5,6 and 7 are chosen, the workforce must be divided into 4. If only January is chosen, the workforce must be divided into 1, and so on. 

Do someone know if this is possible?

1 ACCEPTED SOLUTION
v-yiruan-msft
Community Support
Community Support

Hi @herwet ,

I created a sample pbix file(see attachment) for you, please check whether that is what you want. You can create a measure as below to get the average of workforce base on the selected months:

Average of workforce =
VAR _countofselmonth =
    CALCULATE ( DISTINCTCOUNT ( 'Date'[Date].[Month] ), ALLSELECTED ( 'Date' ) )
RETURN
    DIVIDE ( SUM ( 'Table'[Workforce] ), _countofselmonth )

yingyinr_0-1645000629008.png

Best Regards

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

2 REPLIES 2
v-yiruan-msft
Community Support
Community Support

Hi @herwet ,

I created a sample pbix file(see attachment) for you, please check whether that is what you want. You can create a measure as below to get the average of workforce base on the selected months:

Average of workforce =
VAR _countofselmonth =
    CALCULATE ( DISTINCTCOUNT ( 'Date'[Date].[Month] ), ALLSELECTED ( 'Date' ) )
RETURN
    DIVIDE ( SUM ( 'Table'[Workforce] ), _countofselmonth )

yingyinr_0-1645000629008.png

Best Regards

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

@herwet , In case you have a date table with month year

 

count of selected months

countx(summarize(allselected('Date'[Month Year])), [Month year])

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.