cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Roco Regular Visitor
Regular Visitor

Calculated Column

Hi,

Based on the following diagram,


TASK-INDICATOR.png
I want to create the next calculated column, value, in the table INDICATOR based on two metrics and one variable:

value=(deliveries/planedDeliveries)*weight

metrics:

mDeliveries = sum(deliverie)
mPlanedDeliveries = sum(planedDeliverie)

I have done this but i'm not getting the correct values, so i created another two costum columns deliveries and planedDeliveries, to check what was causing the trouble:

deliveries = mDeliveries
planedDeliveries = mPlanedDeliveries

and i verified that the column planedDeliveries is giving diferent values from the expected in each line, i also tried to calculate:

planedDeliveries = CALCULATE( SUM (TASK[planedDeliverie]), FILTER (TASK, GE_TAREFAS[ID_Indicador] = EARLIER (INDICATOR[ID_Indicador] )))

but is giving me the same wrong values.

When i filter the metric planedDeliveries in the Dashboard it is giving correct values.

Can you someone tell me why i am not getting correct values in the costum column for the planedDeliveries ?

Thanks,
ROCO

6 REPLIES 6
Super User
Super User

Re: Calculated Column

@Roco you have to add these as measures, not columns.






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

Proud to be a Datanaut! Appreciate your Kudos Smiley Happy
Feel free to email me with any of your BI needs.





Roco Regular Visitor
Regular Visitor

Re: Calculated Column

@parry2k thanks for the reply, but as i said above i already tried with measures (metrics):
value=(deliveries/planedDeliveries)*weight
metrics (measures):
mDeliveries = sum(deliverie)
mPlanedDeliveries = sum(planedDeliverie)
but i'm not getting the correct values...
I have to get all the INDICATOR values in the column value to do other further calculations based on that column.
As i said the problem is with the measure mPlanedDeliveries = sum(planedDeliverie) that is not giving the correct values in each row of the INDICATOR table.

 

Do you know or have an idea why?

Community Support Team
Community Support Team

Re: Calculated Column

Hi @Roco 

You could create measures as below

sum_delivery = SUM(task[delivery])

sum_planned = SUM(task[planned delivery])

measure_value = ([sum_delivery]/[sum_planned])*SUM(indicator[weight])

6.png

 

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.

Roco Regular Visitor
Regular Visitor

Re: Calculated Column

Hi @v-juanli-msft ,

 

Thanks for the answer, i already did those metrics, but the problem is that the metric:

SUM(task[planned delivery])

 is giving me diferent values from the expect ones, when i calculate it in a custom column, i need to do this calculation in a custom column:

([sum_delivery]/[sum_planned])*SUM(indicator[weight])

because i need to do further calculation based on the values of this column.

It's strange because the sum(task[delivey]) is giving correct values, but the sum(task[planned delivey]) not, when calculated in the custom column.

 

Do you have any idea why this is happening?

 

 

Roco Regular Visitor
Regular Visitor

Re: Calculated Column

I just noticed what the problem is, i want to filter the Calculated Column:

planned_Deliveries = SUM(task[planned delivery])

In the report by Task[date], and it's not filtering (this column comes from SSAS).

 

Is it possible to filter a Calculated Column from SSAS in Power BI?

Community Support Team
Community Support Team

Re: Calculated Column

Hi @Roco 

When connect to SSAS with live connection, you could only create measure not columns, what you create in Power BI can't return back to SSAS.

 

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.

Helpful resources

Announcements
Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Power BI Helps Homeless and Trouble Youth

Power BI Helps Homeless and Trouble Youth

We spoke with Power BI Super User, Greg Deckler, about his charity work

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 354 members 3,147 guests
Please welcome our newest community members: