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
Anonymous
Not applicable

I need to add runnng total for each month using measure.

I have created this data using calculated measure and know I want to measure sum for each running month For rep_month.

example :

for 1st column 2nd column and 3rd measure 

For Jan I need sum of all jan 

feb sum of jan+ feb

march- sum of jan+feb+march

april= sum of jan+feb+march+april

 

 

 

Capture.PNG

5 REPLIES 5
v-shex-msft
Community Support
Community Support

Hi @Anonymous ,

It is hard to coding formula without any detail information, please share some sample data for test.

How to Get Your Question Answered Quickly

Regards,

Xiaoxin Sheng

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

Here is the sample data for creating a measure. From this data, I have created a measure for each Rollup location and NPSCAT

1.PNG

 

I have used below formula for creating measure.

promoter Measure = COUNTROWS(FILTER('all data','all data'[Rollup]="EMEALA" && 'all data'[NPSCat] = "Promoter"))
Decorate Measure = COUNTROWS(FILTER('all data','all data'[Rollup]="EMEALA" && 'all data'[NPSCat] = "Detractor"))
 Passive Measure = COUNTROWS(FILTER('all data','all data'[Rollup]="EMEALA" && 'all data'[NPSCat]="Passive"))
 
Capture.JPG
 
from the above measures, I need to calculate the sum of three measures for every 3 consecutive months.
 
Here is the measure I'm using to calculate for every 3 consecutive months 
_Measure = IF(MIN('all data'[Month])>=5,CALCULATE([promoter Measure]+[Passive Measure]+[Decorate Measure],FILTER(ALL('all data'),'all data'[Rep_Date]<=MAX('all data'[Rep_Date])&& MONTH('all data'[Rep_Date])>=MONTH(MAX('all data'[Rep_Date]))-3),CALCULATE([promoter Measure]+[Passive Measure]+[Decorate Measure],FILTER(ALL('all data'),'all data'[Rep_Date]<=MAX('all data'[Rep_Date])))))
 
Please let me know the solution.

 

 

Hi @Anonymous ,

You can try to use following measure formula:

_Measure =
CALCULATE (
    [promoter Measure] + [Passive Measure] + [Decorate Measure],
    FILTER (
        ALLSELECTED ( 'all data' ),
        'all data'[Rep_Date] <= MAX ( 'all data'[Rep_Date] )
            && INT ( MONTH ( 'all data'[Rep_Date] ) / 3 )
                + IF ( MOD ( MONTH ( 'all data'[Rep_Date] ), 3 ) > 0, 1, 0 )
                = INT ( MONTH ( MAX ( 'all data'[Rep_Date] ) ) / 3 )
                    + IF ( MOD ( MONTH ( MAX ( 'all data'[Rep_Date] ) ), 3 ) > 0, 1, 0 )
    )
)

Regards,

Xiaoxin Sheng

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

@v-shex-msft ,

 

I need to add 3 consecutive months from the above data. I have to calculate the \

 

jan = jan

feb = Jan+feb

march = jan+feb+march

april = feb+march+april

may = march+april+may...... so on upto december 

 

I'm new to power bi. please help me out for the above measure.

HI @Anonymous ,

Please try to use following measure if it works, I modify conditions to summary rolling three month records:

_Measure =
CALCULATE (
    [promoter Measure] + [Passive Measure] + [Decorate Measure],
    FILTER (
        ALLSELECTED ( 'all data' ),
        'all data'[Rep_Date] <= MAX ( 'all data'[Rep_Date] )
            && MONTH ( 'all data'[Rep_Date] )
                >= MONTH ( MAX ( 'all data'[Rep_Date] ) ) - 2
            && MONTH ( 'all data'[Rep_Date] ) <= MONTH ( MAX ( 'all data'[Rep_Date] ) )
    )
)

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

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.

Top Solution Authors