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

How to Calculate Number os Stores that opens in a certain Period

Hello Everyone!

In my organization, the sales area must bring a lot of stores to our plataform that is a marketplace. (same idea as UberEats)

I would like to know, above all the stores that we have in a certain area, how many open stores we have in the morning, afternoon, at night in every day of the week.

In my database we have this columns:

Store_ID, Time_Open, Time_Closed, Day

 

So, just to give an example, if I have a Store_ID that has a Time_Open = 09 and Time_Closed 13, on monday.

He should appear open at 09,10,11,12,13 on monday. So the time range is very important here.

Just a important detail, the Time_Open and Time_Closed both are whole number type.

 

I thought about something like:

Monday -> Morning (5 Stores open), Afternoon (10 Stores open), Night (20 Stores open)

Tuesday -> The same thing.

And do this to every day of the week.

 

Thank you very much in advance guys!!

Have a good day

1 ACCEPTED SOLUTION

Hi @Anonymous ,

I attached the possibility to select the weekday and date with a hierachy slicer. Take a look at the new PBIX-file:

01-05-_2021_14-05-47.png

With kind regards from the town where the legend of the 'Pied Piper of Hamelin' is at home
FrankAT (Proud to be a Datanaut)

View solution in original post

5 REPLIES 5
FrankAT
Community Champion
Community Champion

Hi @Anonymous ,

here is my sample. Take a look at the attached PBIX-file.30-04-_2021_22-24-33.png

30-04-_2021_22-24-56.png

 

With kind regards from the town where the legend of the 'Pied Piper of Hamelin' is at home
FrankAT (Proud to be a Datanaut)

Anonymous
Not applicable

Thank you so much!!

You are a life saver!!

Best Regards

Anonymous
Not applicable

That solution is outstanding!! But I only missed the day part. Every store has a different open time and close time for day. So it is important to add this variable (monday, tuesday, wednesday, and all)

It is possible to add the day variable, so we can check as a filter?

Hi @Anonymous ,

I attached the possibility to select the weekday and date with a hierachy slicer. Take a look at the new PBIX-file:

01-05-_2021_14-05-47.png

With kind regards from the town where the legend of the 'Pied Piper of Hamelin' is at home
FrankAT (Proud to be a Datanaut)

TomMartens
Super User
Super User

Hey @Anonymous ,

Please consider to create a pbix file that contains sample data, but still reflects the data model (https://docs.microsoft.com/en-us/learn/modules/design-model-power-bi/).
You can use this to enter data directly in Power BI Desktop: https://docs.microsoft.com/en-us/power-bi/connect-data/desktop-enter-data-directly-into-desktop. Upload the pbix file to onedrive or dropbox and share the link. If you are using Excel to create the sample data, share the xlsx as well.
Create columns that contain the expected results, use the sample data to explain how the result is derived from the sample data.

 

Regards,
Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

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.