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

% growth in monthly report

Hi Folks 

 

I have table like below 

Considconsdatestatecity 
qqjh2021-08-01ONtoronto
skjdf2021-07-01QCMontreal
dksdlksm2021-07-10QCMontreal
wodmslm2021-08-01QCMontreal
djnhm2021-07-10ONtoronto
lklj2021-08-10ONtoronto
sclzx2021-07-10ONtoronto
efrd2021-06-10ONtoronto
aaa2021-06-01QCMontreal
gfg2021-06-22QCMontreal

 

I need to show a table that show month to month count (consID) and %Growth of  each month  like this 

 

        
Count of ConsidColumn Labels     
Row LabelsJunJulAugGrand Total   
ON235137324696 JUL - Jun /JUN = =  -98 /235 aug -Jul /JUL  ==  187 /137 
toronto235137324696   
QC122132100354   
Montreal122132100354   
Grand Total3572694241050   
        
        
        

 

 

what is your sugesstion ?! 

 

1 ACCEPTED SOLUTION
VahidDM
Super User
Super User

Hi @Mniknejad 

 

Try this measure:

%Growth = 
VAR _LastM =
    CALCULATE (
        COUNTA ( 'Table'[Consid] ),
        ALLEXCEPT ( 'Table', 'Table'[consdate], 'Table'[state], 'Table'[city ] ),
        PREVIOUSMONTH ( 'Table'[consdate] )
    )
VAR _ThisM =
    COUNTA ( 'Table'[Consid] )
RETURN
    IF ( ISBLANK ( _LastM ), BLANK (), ( _ThisM - _LastM ) / _LastM )

 

Output:

VahidDM_0-1638330914879.png

 

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

View solution in original post

3 REPLIES 3
v-xiaotang
Community Support
Community Support

Hi @Mniknejad 

Based on the sample you attached, you can try this,

create the measure

growth = 
    var _premonth=MAX('calendar'[Month])-1
    var _thiscount=CALCULATE(COUNT('Table'[Consid]),'Table')
    var _precount=CALCULATE(COUNT('Table'[Consid]),FILTER(ALLEXCEPT('Table','Table'[state],'Table'[city]),MONTH('Table'[consdate])=_premonth))
return DIVIDE(_thiscount-_precount,_precount,BLANK())

vxiaotang_1-1640140645328.png

 

Best Regards,

Community Support Team _Tang

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

Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached sample pbix file.

I suggest having a Dim-Calendar table.

 

Picture1.png

 

ID Count: =
COUNTROWS ( Data )
 
ID count Previous Month: =
CALCULATE ( [ID Count:], DATEADD ( 'Calendar'[Date], -1, MONTH ) )
 
ID Count Growth: =
IF (
ISBLANK ( [ID Count:] ),
BLANK (),
DIVIDE ( [ID Count:] - [ID count Previous Month:], [ID count Previous Month:] )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


VahidDM
Super User
Super User

Hi @Mniknejad 

 

Try this measure:

%Growth = 
VAR _LastM =
    CALCULATE (
        COUNTA ( 'Table'[Consid] ),
        ALLEXCEPT ( 'Table', 'Table'[consdate], 'Table'[state], 'Table'[city ] ),
        PREVIOUSMONTH ( 'Table'[consdate] )
    )
VAR _ThisM =
    COUNTA ( 'Table'[Consid] )
RETURN
    IF ( ISBLANK ( _LastM ), BLANK (), ( _ThisM - _LastM ) / _LastM )

 

Output:

VahidDM_0-1638330914879.png

 

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

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