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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
RH205
Helper I
Helper I

Calculate measure based on startdate from dimension table

hi, hope somebody loves a challenge;)

 

we would like to sum two measures based on company startdate..

1. revenue = CALCULATE([revenue] ,FILTER(ALL('Date'), 'Date'[Date] <= MAX('Date'[Date]))

2. revenue_source_external = CALCULATE ([revenue],revenue[date] = MAX ( revenue[date] ))

 

company table:

company | startdate

a                     1-7-2025

b                     1-1-2020

 

revenue table:

company | date | revenue | revenue_source_external| etc

 

if year/month selected = 2025-07 then we would like to see the following in a matrix, with in the rows the companies and in the columns year-month:

 

sum of company a: revenue_source_external until 1-7-2025 and from 1-7-2025 revenue

+

sum of company b: revenue from 2020 until now

 

we have got it working, but it is not showing totals. I cannot share pbix because of company info. Does anybode have a clue?

 

 

 

 

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

Hi @RH205,

Thank you @lbendlin, for your insights.

I reproduced your issue with sample data and was able to create the issue in Power BI. I've attached the PBIX file for your reference.

vsaisraomsft_0-1757919004938.png

 

Thank you.

View solution in original post

4 REPLIES 4
v-saisrao-msft
Community Support
Community Support

Hi @RH205,

Have you had a chance to review the solution we shared earlier? If the issue persists, feel free to reply so we can help further.

 

Thank you.

v-saisrao-msft
Community Support
Community Support

Hi @RH205,

Thank you @lbendlin, for your insights.

I reproduced your issue with sample data and was able to create the issue in Power BI. I've attached the PBIX file for your reference.

vsaisraomsft_0-1757919004938.png

 

Thank you.

Perfect, thnx!

lbendlin
Super User
Super User

1.  You cannot use the transaction date from the dimension table. It must come from the fact table.

2. Use variables to protect your values from the CALCULATE context transition.

we have got it working, but it is not showing totals.

Please elaborate.

 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you provided.

Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

 

 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.