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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
TOYER01
Helper I
Helper I

HOW TO CALCULATE ACTUAL SALES FOR A PARTICULAR MONTH

I have a table called Sales Summary, which is directly connected to SAP BW report. so it already have JAN-APR sales.

 

Another Table, called Target, where the target for each month and recorded.

 

I want to get below;

 

1. Calculate sales for a particular month by only calculating sales with date e.g (01.01.2023 to 31.01.2023, 01.02.2023 to 28.02.2023, 01.03.2023 to 31.03.2023, 01.04.2023 to 30.04.2023), so that i can get the percentage difference of actual vs target

 

2. to be able to use filter or slicer to spool from Sales Summary table, the actual sales and display it in the dashboard

 

I will appreciate if you can help

 

11 REPLIES 11
DOLEARY85
Super User
Super User

Hi,

 

try this measure:

 

Measure =

CALCULATE(sum(Table1[Sales]),ALLEXCEPT(Table1,Table1[Date].[Month],Table1[Date].[Year]))
 
this will provide a total sum for each month year, you'll need a field that only displays the Month and Year to summarise by in the table.
 
I just created a calculated column based on the datat you shared for this:
 
Column = Table1[Date].[Month] & " " & Table1[Date].[Year]
 
 
 
DOLEARY85_0-1682258401196.png

 If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

Thank you for your response.

 

Please how do i create the calculated column.

 

I have created the measure so am lost after that.

Where you click to create new measure, the option underneath should be new column

DOLEARY85_0-1682261559538.png

 

 

, then just use the formula 

 

= Table1[Date].[Month] & " " & Table1[Date].[Year]   to create the new date field 

 

If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

TOYER01_0-1682275772975.png

 

This is where i hang, could not go further

I've uploaded an example based on the first 5 rows of your data here:

 

Power BI File

 

see if this helps

 

If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

Yes, I saw it, this is viewed on a slicer or filter.

 

What am requesting is, I want the actual sales for each month in a table, having 2 columns:  Month & Sales

 

In my screenshot,

Sales Summary table contain actual sales from JAN till date

Target Table contain targets of each state

achievement table will contain the summary of sales derived from Sales Summary Table, it will have 2 columns (Month and Sales)

 

Apologies for giving you back and forth on this, am still a newbee

 

 

No problem, 

 

  1. So if you go to report view:DOLEARY85_0-1682277394567.png
  2. create the new column by right clicking on the table on the right hand side.
  3. Enter the formula:     Month Year = Table1[Date].[Month] & " " & Table1[Date].[Year]
  4. add this column to the table visualisation
  5. then add the measure you previously created to the table too

 

If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

TOYER01
Helper I
Helper I

TOYER01_0-1682256519795.png

 

Like Sample Above. So i want it to calculate April Sales

DOLEARY85
Super User
Super User

Hi, 

 

do you have an example of how the data looks or able to share the PBIX file?

 

Without knowing the structure of the data I would assume you have a date field in the sales table. If you extract the month and year into separate fields then use something like the below to sum the sales for that particular month:

 

Measure 5 = CALCULATE(sum('Sales Summary'[Amount]),ALLEXCEPT('Sales Summary','Sales Summary'[Month],'Sales Summary'[Year])
 
If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

TOYER01_0-1682258461184.png

 

Like Sample Above. So i want it to calculate April Sales

Have a look here:

 

Power BI File 

 

If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.