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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
grubpot
Frequent Visitor

Calculate a measure by individual date period, instead of calculate over entire table

Hello,

A follow up question for an item I posted that was 90% solved!

I have a measure that I need to summarise by date. Instead of calculating over the entire table.

 

I can't see how to insert sample file, so below is some example data:

 

Current data structure has product, customer, date, forecast and ordered quantity.

 

ProductCustomerDateForecastOrdered
AJoe Bloggs01-Jan10085
ABill Gates01-Jan7570
AMike Smith01-Jan6080
AEddie Jordan01-Jan5090
ABrian Bones01-Jan5550
AJim Bob01-Jan8070
ARicky Smart01-Jan9080
BJoe Bloggs01-Jan6085
BBill Gates01-Jan5070
BMike Smith01-Jan5580
BEddie Jordan01-Jan8090
BBrian Bones01-Jan9050
BJim Bob01-Jan6080
BRicky Smart01-Jan5070
CJoe Bloggs01-Jan5580
CBill Gates01-Jan8085
CMike Smith01-Jan9070
CEddie Jordan01-Jan6080
CBrian Bones01-Jan5090
CJim Bob01-Jan5550
CRicky Smart01-Jan8090
AJoe Bloggs02-Jan5550
ABill Gates02-Jan8070
AMike Smith02-Jan9080
AEddie Jordan02-Jan6085
ABrian Bones02-Jan5070
AJim Bob02-Jan5580
ARicky Smart02-Jan8090
BJoe Bloggs02-Jan9050
BBill Gates02-Jan6080
BMike Smith02-Jan5070
BEddie Jordan02-Jan5580
BBrian Bones02-Jan8085
BJim Bob02-Jan9070
BRicky Smart02-Jan10080
CJoe Bloggs02-Jan7590
CBill Gates02-Jan6050
CMike Smith02-Jan5090
CEddie Jordan02-Jan5550
CBrian Bones02-Jan8070
CJim Bob02-Jan9080
CRicky Smart02-Jan6085
AJoe Bloggs03-Jan5070
ABill Gates03-Jan5580
AMike Smith03-Jan8090
AEddie Jordan03-Jan6050
ABrian Bones03-Jan5080
AJim Bob03-Jan5570
ARicky Smart03-Jan8080
BJoe Bloggs03-Jan9085
BBill Gates03-Jan6070
BMike Smith03-Jan5080
BEddie Jordan03-Jan5590
BBrian Bones03-Jan8050
BJim Bob03-Jan6090
BRicky Smart03-Jan5050
CJoe Bloggs03-Jan5570
CBill Gates03-Jan6080
CMike Smith03-Jan5085
CEddie Jordan03-Jan5570
CBrian Bones03-Jan8080
CJim Bob03-Jan6090
CRicky Smart03-Jan5050

 

Then my measure works out the ordered vs forecast at product level.

a  +/-15%  difference between forecast and ordered is acceptable.

 

DateProductTotal ForecastTotal OrderedTolerance
01-JanA5105253%
01-JanB44552518%
01-JanC47054516%
02-JanA47052512%
02-JanB525515-2%
02-JanC47051510%
03-JanA43052021%
03-JanB44551516%
03-JanC41052528%

 

 

then finally, this is the resuly I need. The number of products that hit the target +/- 15% by date.

 

I have a formula for the measure, but it only looks at the entire block of data, whereas I need to summarise by date.

 

 Total products orderedNumber of products in acceptable  toleranceTolerance Rate
01-Jan3133%
02-Jan33100%
03-Jan3133%
Grand Total9556%

 

Would anyone have any idea how to achieve this?

 

Many thanks

1 ACCEPTED SOLUTION

Hi,

I found a solution... the solution was to use summarize!

 

Accuracy count =

VAR summarizedTable =
SUMMARIZE('Weekly Forecast Accuracy set datesnew','SAP dates'[Week / Yr],"Count acc", [Count in tolerance])

RETURN
SUMX(summarizedTable,[Count in tolerance])

View solution in original post

2 REPLIES 2
grubpot
Frequent Visitor

 

If I put my measusre into a table it gives the correct result for the individual dates.

However the total does not work - it looks at all the data together instread of the total of each individual result.

 

output2.png

 
 

Hi,

I found a solution... the solution was to use summarize!

 

Accuracy count =

VAR summarizedTable =
SUMMARIZE('Weekly Forecast Accuracy set datesnew','SAP dates'[Week / Yr],"Count acc", [Count in tolerance])

RETURN
SUMX(summarizedTable,[Count in tolerance])

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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