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

KPI - Calculate result from month and accumulate throughout the year

Hello colleagues!

 

I have a KPI that measures a relation of the number of people in the company by the end of month and the number of occurrences of an activity within that certain month.

It divides the occurrences / number of people.

To bring the accumulated result for more than 1 period, it needs to make that calculation for each month individually and sum the result.

 

However, as I have a list of people for each month, doing a countrows sums all the number of people of all months - not bringing the correct result.

 

Can you please please support on the measure of advices?

 

2022-05-04 09_40_05-Window.png

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

Hi @uie07923 ,

 

You could create a measure like below:

measure =
IF (
    ISINSCOPE ( 'Table'[date].[Month] ),
    [Fluctuation],
    SUMX (
        FILTER (
            ALL ( 'Table' ),
            'Table'[date].[Year] = SELECTEDVALUE ( 'Table'[date].[Year] )
        ),
        [Fluctuation]
    )
)

 

Best Regards,

Jay 

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

2 REPLIES 2
v-jayw-msft
Community Support
Community Support

Hi @uie07923 ,

 

You could create a measure like below:

measure =
IF (
    ISINSCOPE ( 'Table'[date].[Month] ),
    [Fluctuation],
    SUMX (
        FILTER (
            ALL ( 'Table' ),
            'Table'[date].[Year] = SELECTEDVALUE ( 'Table'[date].[Year] )
        ),
        [Fluctuation]
    )
)

 

Best Regards,

Jay 

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

@uie07923 , not very clear, if you have date you can use datesytd

 

YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))

 

or

 

YTD= CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Year]=max('Date'[Year]) && 'Date'[Month] <= Max('Date'[Month]) ))

 

 

Cumulative across year


Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(all('Date'),'Date'[date] <=max('Date'[date])))

 

If this does not help
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.