Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Jay2022
Helper III
Helper III

Number of type a and b stores opening by month

So This problem is in 2 parts 

 

Firstly I want to calculate accumulative totals of store a and b types opening by end of september, october, nov and so on 

one column store type with vaules a,b, c and d another column dates 

 

secondly i have measure which have counted total number of stores (TOTAL_NO_STORES) and another which as counted number os stores c and d (C&D) which have already opened therefore i want to plot number of store a and b's each month add them to the the total already opened stores and divide this by total number of stores so it should go up septemner 80%, october 83% and so on. 

 

Any help greatly appreciated 

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

Hi @Jay2022 ,

Based on the description, please try the following methods:

1.Create the sample table.

vjiewumsft_0-1730169790472.png

2.Create the measure to calculate accumulative totals of store a and b.

Cumulative_StoreA = 
    CALCULATE(
        COUNTROWS('Table'),
        FILTER(ALL('Table'),
            'Table'[Date] <= MAX('Table'[Date]) &&
            'Table'[Store Type] = "A"
        )
    )
Cumulative_StoreB = 
    CALCULATE(
        COUNTROWS('Table'),
        FILTER(ALL('Table'),
            'Table'[Date] <= MAX('Table'[Date]) &&
            'Table'[Store Type] = "B"
        )
    )

3.Create the new measure to calculate the percentage for each month.

Percentage_Opened = 
    DIVIDE(
        [Cumulative_StoreA] + [Cumulative_StoreB] + [C&D],
        [TOTAL_NO_STORES],
        0
    )

4.The result is shown below.

vjiewumsft_1-1730169803369.png

 

Best Regards,

Wisdom Wu

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-jiewu-msft
Community Support
Community Support

Hi @Jay2022 ,

Based on the description, please try the following methods:

1.Create the sample table.

vjiewumsft_0-1730169790472.png

2.Create the measure to calculate accumulative totals of store a and b.

Cumulative_StoreA = 
    CALCULATE(
        COUNTROWS('Table'),
        FILTER(ALL('Table'),
            'Table'[Date] <= MAX('Table'[Date]) &&
            'Table'[Store Type] = "A"
        )
    )
Cumulative_StoreB = 
    CALCULATE(
        COUNTROWS('Table'),
        FILTER(ALL('Table'),
            'Table'[Date] <= MAX('Table'[Date]) &&
            'Table'[Store Type] = "B"
        )
    )

3.Create the new measure to calculate the percentage for each month.

Percentage_Opened = 
    DIVIDE(
        [Cumulative_StoreA] + [Cumulative_StoreB] + [C&D],
        [TOTAL_NO_STORES],
        0
    )

4.The result is shown below.

vjiewumsft_1-1730169803369.png

 

Best Regards,

Wisdom Wu

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

lbendlin
Super User
Super User

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information. Do not include anything that is unrelated to the issue or question.

Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.