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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ghouse_peer
Post Patron
Post Patron

fiscal month task

Hello , I am new to power bi, kindly  tell me how to Create a Total Sales variance % for all the Fiscal Months of the year..

1 ACCEPTED SOLUTION
v-xicai
Community Support
Community Support

Hi @ghouse_peer ,

 

You may create relationship between the table "Time" and Sales, then create measures like DAX below.

 

 

Current Month Sales = CALCULATE(SUM(Sales[Regular_sales])+ SUM(Sales[Markdown_sales]),DATESMTD('Time'[Date]))



Last Month Sales = CALCULATE(SUM(Sales[Regular_sales])+ SUM(Sales[Markdown_sales]),DATESMTD(dateadd('Time'[Date],-1,MONTH)))



Variance %= IF([Last Month Sales ]<>BLANK(), DIVIDE([Current Month Sales],[Last Month Sales], 0)-1,0)

 

 

Then you may choose table or Matrix to display the result, and format the  data type of 'Time'[Date] as "yyyy-mm".

 

Best Regards,

Amy 

 

Community Support Team _ Amy

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-xicai
Community Support
Community Support

Hi @ghouse_peer ,

 

You may create relationship between the table "Time" and Sales, then create measures like DAX below.

 

 

Current Month Sales = CALCULATE(SUM(Sales[Regular_sales])+ SUM(Sales[Markdown_sales]),DATESMTD('Time'[Date]))



Last Month Sales = CALCULATE(SUM(Sales[Regular_sales])+ SUM(Sales[Markdown_sales]),DATESMTD(dateadd('Time'[Date],-1,MONTH)))



Variance %= IF([Last Month Sales ]<>BLANK(), DIVIDE([Current Month Sales],[Last Month Sales], 0)-1,0)

 

 

Then you may choose table or Matrix to display the result, and format the  data type of 'Time'[Date] as "yyyy-mm".

 

Best Regards,

Amy 

 

Community Support Team _ Amy

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

amitchandak
Super User
Super User

@ghouse_peer ,The information you have provided is not making the problem clear to me. Can you please explain with an example.

You can create measure like this for this month vs last month and take the variance

MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))

Hello @amitchandak 

 

I have a table 'Sales' 

from table 'sales' i need to extract new coulumn defination from 2 columns i,e Total sales =[Regular_sales]+[Markdown_sales], these 2 columns are presnt in sales.

In another table 'Time' i have column month where it contains dates in the format mm/dd/yy.

 

now the task is i need to create  Total Sales variance % for all the Fiscal Months of the year.. Kindly help

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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