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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Anonymous
Not applicable

Date Modelling Issue !!!!!!

I am being a Merchant, I need to know if the Sales is happening or not and for which Product sales is happening.

My Sales will happen 24*7 and my sales will be calculated every 30 minutes.

 

Below are my Product Details:

 

Product Name

Shirt

Dhoti

Sarees

Towel

T-Shirt

Pant

Churidar

Inner wears

Apparels

Others

 

One day Sample data for one Product is as below:

 

Product Name

Date

Hour

Minute

Sale Status

Shirt

1/1/2019

0

0

1

Shirt

1/1/2019

0

30

1

Shirt

1/1/2019

1

0

1

Shirt

1/1/2019

1

30

1

Shirt

1/1/2019

2

0

1

Shirt

1/1/2019

2

30

1

Shirt

1/1/2019

3

0

1

Shirt

1/1/2019

3

30

1

Shirt

1/1/2019

4

0

1

Shirt

1/1/2019

4

30

1

Shirt

1/1/2019

5

0

1

Shirt

1/1/2019

5

30

1

Shirt

1/1/2019

6

0

1

Shirt

1/1/2019

6

30

1

Shirt

1/1/2019

7

0

1

Shirt

1/1/2019

7

30

1

Shirt

1/1/2019

8

0

1

Shirt

1/1/2019

8

30

1

Shirt

1/1/2019

9

0

1

Shirt

1/1/2019

9

30

1

Shirt

1/1/2019

10

0

1

Shirt

1/1/2019

11

0

1

Shirt

1/1/2019

11

30

1

Shirt

1/1/2019

12

0

1

Shirt

1/1/2019

12

30

1

Shirt

1/1/2019

13

30

1

Shirt

1/1/2019

14

0

1

Shirt

1/1/2019

15

0

1

Shirt

1/1/2019

15

30

1

Shirt

1/1/2019

16

0

1

Shirt

1/1/2019

17

0

1

Shirt

1/1/2019

17

30

1

Shirt

1/1/2019

18

0

1

Shirt

1/1/2019

18

30

1

Shirt

1/1/2019

19

0

1

Shirt

1/1/2019

20

0

1

Shirt

1/1/2019

21

0

1

Shirt

1/1/2019

21

30

1

Shirt

1/1/2019

23

0

1

Shirt

1/1/2019

23

30

1

 

Now I need to calculate the sum of Sales status per day for all Products.

 

Tried Method:

Created a Reference sheet which have Product name, Date, Hour & Minute. For example, as below and the table will keep growing for all days of a month and for all Products. And I used a Lookupvalue and If Condition function with the Source data and achieved the output in a seprertae column and sum that.

 

Product Name

Date

Hour

Minute

Shirt

1/1/2019

0

0

Shirt

1/1/2019

0

30

Shirt

1/1/2019

1

0

Shirt

1/1/2019

1

30

Shirt

1/1/2019

2

0

Shirt

1/1/2019

2

30

Shirt

1/1/2019

3

0

Shirt

1/1/2019

3

30

Shirt

1/1/2019

4

0

Shirt

1/1/2019

4

30

Shirt

1/1/2019

5

0

Shirt

1/1/2019

5

30

Shirt

1/1/2019

6

0

Shirt

1/1/2019

6

30

Shirt

1/1/2019

7

0

Shirt

1/1/2019

7

30

Shirt

1/1/2019

8

0

Shirt

1/1/2019

8

30

Shirt

1/1/2019

9

0

Shirt

1/1/2019

9

30

Shirt

1/1/2019

10

0

.

.

.

.

.

.

 

Now the problem is:

For one product, 1product*30days*24Hours*2TimeInterval = 1440 rows, so for 10 Products it is 14400 rows and for 12 months 1,72,800 rows and if the product increases and for two/three years, the data file size becomes very big. If the product is more than 100, can’t even imagine the size of the file.

 

Is there any way to overcome this ????

@v-juanli-msft  @Greg_Deckler @ImkeF @Ashish_Mathur 

2 REPLIES 2
kentyler
Solution Sage
Solution Sage

You can google Using a Calendar table in DAX to find more information on the solution suggested.

 





Did this post answer your question? Mark it as a solution so others can find it!

Help when you know. Ask when you don't!




Join the conversation at We Talk BI find out more about me at Slow BI


ImkeF
Community Champion
Community Champion

Hi @Anonymous 

you should create 2 tables:

1) Date/TIme

2) Product

 

Combine your sales table with them and take the fields from the above mentioned tables into the row-and column sections of your matrix or visuals.

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.