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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

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
v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

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.

Anonymous
Not applicable

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?

 

 

Anonymous
Not applicable

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?

Hi @Anonymous 

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.

parry2k
Super User
Super User

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



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

@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?

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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