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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
ASB
New Member

Automatic create table calculate

I have two tables, I have a diferents lits of discounts in text format in the table01, similar to:

Commercial Discount

CEO discount

BP discount

 

In the table 02 i have a lot of products with discounts, name, description, company, etc

 

I create a mesure with this formular:

Total Commercial Discount = -CALCULATE(SUM(Detail[Total COST] );TREATAS({("Commercial Discount")}; 'Detail'[Column1]))

It works, the measure show the sum all Total Cost when in the table02.Column1 i have this text "Commercial Discount"

 

I like create a table with this sum creating a new colum with the Total COST related to the table01

 

Any idea?

 

thanking in advance

 

1 ACCEPTED SOLUTION
v-ljerr-msft
Microsoft Employee
Microsoft Employee

Hi @ASB,

 

Based on my test, the formula below should work in your scenario. Smiley Happy

Column2 = 
- CALCULATE (
    SUM ( Detail[Total COST] );
    FILTER(ALL(Detail);Detail[Column3]=EARLIER(Table01[Column1])
))

r4.PNG

 

Regards

View solution in original post

3 REPLIES 3
v-ljerr-msft
Microsoft Employee
Microsoft Employee

Hi @ASB,

 

If I understand you correctly, you should be able to use the formula below to add a calculate column in table01 in this scenario. Smiley Happy

Column2 =
- CALCULATE (
    SUM ( Detail[Total COST] );
    TREATAS ( { ( EARLIER ( 'table01'[Column1] ) ) }; 'Detail'[Column1] )
)

 

Regards

Hello @v-ljerr-msft

 

thanks for your reply but it is not working, check the details:

3.png2.png1.png

 

could you help me please?

 

thanking in advance

 

regards

v-ljerr-msft
Microsoft Employee
Microsoft Employee

Hi @ASB,

 

Based on my test, the formula below should work in your scenario. Smiley Happy

Column2 = 
- CALCULATE (
    SUM ( Detail[Total COST] );
    FILTER(ALL(Detail);Detail[Column3]=EARLIER(Table01[Column1])
))

r4.PNG

 

Regards

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors