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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Sougata_Biswas
New Member

Calculate Function - Not Working!

Hi, So I have two tables.

1. Dim Date

2. Fact Table

In the dim date table, I have created a new column that contains week numbers. On the other hand, using the fact table I created a new measure that contains my total revenue.

Now I want to calculate revenue each week.

The formula am using is: "Revenue per Week = CALCULATE([Revenue],All('Dim Date'[Weeknum])" 

The result I am getting is:

Sougata_Biswas_0-1715795109291.png

Can someone tell me what am I doing wrong here? 

2 ACCEPTED SOLUTIONS
audreygerred
Super User
Super User

Hi! For Revenue, just make the measure be Revenue = SUM('Your Table'[Revenue]) then in the visual, put the week numbers in and put in the Revenue measure - it will show you your revenue per week naturally. 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

Since the figures are repeating that usually indicated that you don't have the date table joined to the fact table. Check to see if you have the join and if it is there, double check that it is working properly (i.e. put date from fact in a table and date from dim date in the same table and see if both columns are filled in).





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

5 REPLIES 5
audreygerred
Super User
Super User

Hi! For Revenue, just make the measure be Revenue = SUM('Your Table'[Revenue]) then in the visual, put the week numbers in and put in the Revenue measure - it will show you your revenue per week naturally. 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





@audreygerred I tried that too didn't work. 

Sougata_Biswas_0-1715798502581.png

It only works when I create a new column with week numbers in the same table. Not when the week numbers are in another table.

Since the figures are repeating that usually indicated that you don't have the date table joined to the fact table. Check to see if you have the join and if it is there, double check that it is working properly (i.e. put date from fact in a table and date from dim date in the same table and see if both columns are filled in).





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Thank you so much! Yes, there was an error in the relation. 

You're very welcome!





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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