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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Anonymous
Not applicable

Daily Transactions Bypassing Dates

The goal is to calculate sales across all dates regardless if the sales occurred on that date or not. Currently, I am calculating sales that occurred on the date of the transaction (ex: "current_sales_output"). A new business requirement was added where sales are to be calculated over all dates (ex: "desired_sales_output"). Is there a way for me to calculate sales across all dates with the parameters not being before the date of the first sales transaction or beyond the date of the latest transaction? Below you will find the following: Current Sales Output Measure / Sample Data (with current output + desired output). 

 

Your advice is greatly appreciated. 

 

current_sales_output Measure

 

current_sales_output = SUM( Sales[Value] )

 

 

Sample Data (with current output + desired output)

datecurrent_sales_outputdesired_sales_output
Sunday, May 31, 202175
Monday, June 1, 202105
Tuesday, June 2, 202105
Wednesday, June 3, 2021145
Thursday, June 4, 202175
Friday, June 5, 202105
Saturday, June 6, 202175
TOTAL3535
1 ACCEPTED SOLUTION
v-luwang-msft
Community Support
Community Support

Hi @Anonymous ,

IF you want to create a new coulumn to calculate output,use the following:

out1 = SUM('Table'[current_sales_output])/COUNTROWS('Table')

And if you want to create a measure to calculate it ,use the following :

out2 = CALCULATE(SUM('Table'[current_sales_output])/COUNTROWS('Table'),ALL('Table'))

Final output:

vluwangmsft_0-1624851487735.png

 

Wish it is helpful for you!

 

Best Regards

Lucien

View solution in original post

6 REPLIES 6
v-luwang-msft
Community Support
Community Support

Hi @Anonymous ,

IF you want to create a new coulumn to calculate output,use the following:

out1 = SUM('Table'[current_sales_output])/COUNTROWS('Table')

And if you want to create a measure to calculate it ,use the following :

out2 = CALCULATE(SUM('Table'[current_sales_output])/COUNTROWS('Table'),ALL('Table'))

Final output:

vluwangmsft_0-1624851487735.png

 

Wish it is helpful for you!

 

Best Regards

Lucien

AlexisOlson
Super User
Super User

Why 5 for each non-total row? You want to show the average sales?

Anonymous
Not applicable

@AlexisOlson I chose 5 for each non-total row because it was divisible by 7 (as in 7 days). I could have chosen a better number but the goal of my example was to show an example that would be simple and easy to understand. Apologies if it is confusing. 

I'm asking what it represents since 5 is clearly not the total across all dates that you are asking for in your original post but rather the total distributed equally across the dates (which you never mentioned as far as I can tell).

Anonymous
Not applicable

@AlexisOlson The 5 represents the equal distributed total from the sample total of 35 across all of the dates. Ultimately, the business requirements is to look at sales over each quarter. I am replicating a report that was already created which had a calculated column dividing total sales / 90 days. 

 

Please let me know if this can help or is still confusing. 

OK. I'd suggest asking for what you're actually interested in achieving in your post. It's easy to remove all date filtering in a measure to return the total over all dates but that doesn't align with your specified output. I could write a measure that distributes the total over all dates but then I don't know if that's really what you want or if you actually want to distribute over each quarter separately or something else entirely.

Helpful resources

Announcements
Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.