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
Anonymous
Not applicable

Help with calculating a new column

Hi,

I need to show a trend line for the Total and also for the 85% Total, but the value for the Total doesn’t exist in the source data.  To make it more complicated, the 85% Total exists but it’s in a column that also contains Team Members.

 

I’ve tried creating a calculated column that looked something like this:

Total = IF(CONTAINS(Table 1, Table 1[Team], “85% Total”) CALCULATE(Table 1 [Cost])/.85)

 

I also tried using CALCULATE & ALLEXCEPT but haven’t had any success.

 

It’s a straight forward problem in Excel but PBI requires a different twist that I can’t quite put my finger on.

 

The table below shows the existing data in BLACK and two new columns in RED to hold the Total and 85% Total values.

 

Total.JPG

Maybe there's a better approach or possibly some help withi my syntax?  Any input is appreciated.

1 ACCEPTED SOLUTION

I think I understand.

 

Please try these two calculated columns.  For clarity, I have attached a PBIX file. 

 

85% Capacity = 
    IF(
        'Table1'[Team]="85% Capacity",
        'Table1'[Cost]
        )

and

 

Capacity = 
    IF(
        'Table1'[Team]="Capacity", 
        SUM('Table1'[85% Capacity])/.85
        )

image.png


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

View solution in original post

4 REPLIES 4
Phil_Seamark
Employee
Employee

HI @Anonymous

 

So I take it you are trying to generate the numbers in the red box, but only have access to data in the first two column to generate the numbers.   It's not clear what is used to generate the top value of 200,000 and then the 176,470

 

image.png


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Anonymous
Not applicable

Hi Phil,

Sorry.  I should've been clearer with my question. I've recreated the drawing to more closely match the data.  I need to calculate the Capacity.  Unforutnatley, the Capacity numbers aren't part of the source data but the 85% of Capacity is in the source data so  I'm using that to get the full capacity.  To allow me to create two distinct lines in a chart, I believe I'll need to break out these two values into two separate columns (one for Capacity and one for 85%).

 

Does that help at all or did I make it more confusing?

Total.JPG

 

 

I think I understand.

 

Please try these two calculated columns.  For clarity, I have attached a PBIX file. 

 

85% Capacity = 
    IF(
        'Table1'[Team]="85% Capacity",
        'Table1'[Cost]
        )

and

 

Capacity = 
    IF(
        'Table1'[Team]="Capacity", 
        SUM('Table1'[85% Capacity])/.85
        )

image.png


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Anonymous
Not applicable

Phil,

That worked great.  Thanks for the 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.