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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
FABIANSMITS
New Member

Sales Measure

Greetings PBI Team

 

I need to calculate the sales according to what is selected in the calendar, for example, if I have selected the year, the sales are calculated based on that selection, and the same for month and day. Here is an example of the measure I have to calculate the sales in the actual month

 

Can you please give me some help on this? thank you so much

 

FABIANSMITS_0-1673902453488.png

 

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

Hi @FABIANSMITS ,

 

Please try to add a slicer like this:

vjianbolimsft_0-1673924358023.png

You can achieve your goal by using sum of sales directly:

vjianbolimsft_1-1673924420369.png

Or apply a measure like this:

Measure = 
var _a = SELECTCOLUMNS('Calendar',"Date",[Date])
return CALCULATE(SUM('Table'[Total Sales]),FILTER(ALL('Calendar'),[Date] in _a))

Output:

vjianbolimsft_2-1673924480776.png

 

 

Best Regards,

Jianbo Li

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

3 REPLIES 3
v-jianboli-msft
Community Support
Community Support

Hi @FABIANSMITS ,

 

Please try to add a slicer like this:

vjianbolimsft_0-1673924358023.png

You can achieve your goal by using sum of sales directly:

vjianbolimsft_1-1673924420369.png

Or apply a measure like this:

Measure = 
var _a = SELECTCOLUMNS('Calendar',"Date",[Date])
return CALCULATE(SUM('Table'[Total Sales]),FILTER(ALL('Calendar'),[Date] in _a))

Output:

vjianbolimsft_2-1673924480776.png

 

 

Best Regards,

Jianbo Li

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

FreemanZ
Super User
Super User

hi @FABIANSMITS 

how is [actual month] defined?

what issue do you have for the mentioned code?

Ashley the measure is Current Month and is calculated this way:

FABIANSMITS_0-1673922172628.png

and the measure for LAST_DATE_SALES is:

 

FABIANSMITS_1-1673922326319.png

And what i want to do is to adjust my measure so that it can calculate the sales per year, month or day as selected

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

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.