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

Store Expansion calculation

 

Dears, 

I have a customer table and these customers are opening like stores, I want to calculate the new stores that opened for each then calculates the average growth. 

 

I have an open date and store id for each.

Screen Shot 2020-07-14 at 5.29.48 PM.png

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

Hi @Anonymous 

Would you like result below:

Capture2.JPG

count open = DISTINCTCOUNT('Table 2'[store id])

growth % =
VAR m1 =
    DISTINCTCOUNT ( 'Table 2'[store id] ) + 0
VAR m2 =
    CALCULATE (
        DISTINCTCOUNT ( 'Table 2'[store id] ) + 0,
        DATEADD ( 'Date'[Date], -1, MONTH )
    )
VAR s = m1 - m2
RETURN
    IF ( m2 = 0, s / 1, s / m2 )

Date table

Date =
ADDCOLUMNS (
    CALENDARAUTO (),
    "year", YEAR ( [Date] ),
    "month", FORMAT ( [Date], "Mmm" ),
    "year-month", FORMAT ( [Date], "yyyy-mm" )
)

 

Best Regards
Maggie
Community Support Team _ Maggie Li
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

3 REPLIES 3
v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

Would you like result below:

Capture2.JPG

count open = DISTINCTCOUNT('Table 2'[store id])

growth % =
VAR m1 =
    DISTINCTCOUNT ( 'Table 2'[store id] ) + 0
VAR m2 =
    CALCULATE (
        DISTINCTCOUNT ( 'Table 2'[store id] ) + 0,
        DATEADD ( 'Date'[Date], -1, MONTH )
    )
VAR s = m1 - m2
RETURN
    IF ( m2 = 0, s / 1, s / m2 )

Date table

Date =
ADDCOLUMNS (
    CALENDARAUTO (),
    "year", YEAR ( [Date] ),
    "month", FORMAT ( [Date], "Mmm" ),
    "year-month", FORMAT ( [Date], "yyyy-mm" )
)

 

Best Regards
Maggie
Community Support Team _ Maggie Li
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

@Anonymous , growth is related to period. You can use time intelligence. You can join start date with a date table. and then have measure store open this month , last month an calculate gowth

example

MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))

diff = [MTD Sales]-[last MTD Sales]
diff % = divide([MTD Sales]-[last MTD Sales],[last MTD Sales])

QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(('Date'[Date])))
Last QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(dateadd('Date'[Date],-1,QUARTER)))

YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))
Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

See if my webinar on Time Intelligence can help: https://community.powerbi.com/t5/Webinars-and-Video-Gallery/PowerBI-Time-Intelligence-Calendar-WTD-YTD-LYTD-Week-Over-Week/m-p/1051626#M184


Appreciate your Kudos.

Pragati11
Super User
Super User

Hi @Anonymous ,

 

It will be nice to have some sample data here so that proper calculations can be suggested.

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

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.