cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
houss Frequent Visitor
Frequent Visitor

Calculate a column from two calculated column in a report table

Hi dear community !

 

I have a table on my report where i put the number of cars at date 1, the % of the total1 (by adding the same column and put it as "percent of a grand total"), number of cars at date 2 and % of the total2  for this date (same process).

 

But I want to add a column to my table to compute this formula : (%of total2 - %of total1)/ %of total2.

 

I tried with measures, quick measures.... but the issue is that I can't work with these columns values as variables like the number of cars (which are 2 calculated measures), it's calculated only in the table.

 

I think the solution is not so complicated but to find it I need your help.

 

Thank you !

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Calculate a column from two calculated column in a report table

Hi @houss 

% total_2 =
CALCULATE ( SUM ( 'Table'[number] ), ALLEXCEPT ( 'Table', 'Table'[date] ) )
    / CALCULATE ( SUM ( 'Table'[number] ), ALL ( 'Table' ) )

Change the measure as below

% total_2 =
SUMX(ALLEXCEPT ( 'Table', 'Table'[date] ),'Table'[number])
    / SUMX(  ALL ( 'Table' ) ,'Table'[number])

 

Best Regards
Maggie

 

Community Support Team _ Maggie Li
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
Community Support Team
Community Support Team

Re: Calculate a column from two calculated column in a report table

Hi @houss 

Assume you have a table as below

Capture2.JPG

% of total2 = (numbers of cars for each date)/(numbers of cars for all dates)

% of total1= (numbers of cars for each previous date)/(numbers of cars for all dates)

 

Something as below:

Capture3.JPG

 

You could create measures

% total_2 =
CALCULATE ( SUM ( 'Table'[number] ), ALLEXCEPT ( 'Table', 'Table'[date] ) )
    / CALCULATE ( SUM ( 'Table'[number] ), ALL ( 'Table' ) )

% total_1 = CALCULATE([% total_2],FILTER(ALL('Table'),'Table'[date]=MAX('Table'[date])-1))

Measure = ([% total_2]-[% total_1])/[% total_2]

 

Best Regards
Maggie

 

Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

houss Frequent Visitor
Frequent Visitor

Re: Calculate a column from two calculated column in a report table

Hi Maggie,

 

I think we are close to the solution. I have only a little issue with you method, i cant call Table'number' because in my case it's a measure. So i can't call a measure in the funciton SUM. 

 

I'll try to find a way !

 

If you have any suggestion, i'm open.

 

Thank you 🙂

Community Support Team
Community Support Team

Re: Calculate a column from two calculated column in a report table

Hi @houss 

% total_2 =
CALCULATE ( SUM ( 'Table'[number] ), ALLEXCEPT ( 'Table', 'Table'[date] ) )
    / CALCULATE ( SUM ( 'Table'[number] ), ALL ( 'Table' ) )

Change the measure as below

% total_2 =
SUMX(ALLEXCEPT ( 'Table', 'Table'[date] ),'Table'[number])
    / SUMX(  ALL ( 'Table' ) ,'Table'[number])

 

Best Regards
Maggie

 

Community Support Team _ Maggie Li
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

Helpful resources

Announcements
Ask Amanda Anything Q&A

Ask Amanda Anything Q&A

Learn the answers to some of the questions asked during the Amanda Triple A event.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 297 members 2,999 guests
Please welcome our newest community members: