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

Calculated Column

Hi,

 

I have created the following calculated column:

ActualValueW =  [ActualValue]*Indicator[weight]

ActualValue is a metric that sums values from the table Tasks, each Indicator has one or many Taks 1-*.

The problem is that i want that the ActualValueW gives me ActualValue for the tasks linked the each indicator (each row of table Indicator), but it is giving me diferent values from the expected values.

 

Task-Indicator 2.png

 

Can you tell what am i doing wrong? Which is the correct way to do this?

 

Thanks,

ROCO

6 REPLIES 6
Super User
Super User

Re: Calculated Column

@Roco 

 

Try following

 

=
SUMX ( RELATEDTABLE ( TASK ), TASK[VALUE] ) * [Weight]
Roco Regular Visitor
Regular Visitor

Re: Calculated Column

@Zubair_Muhammad 

 

thanks, but it's giving me the same result, i think i need to filter by id_Indicator, like this:

 

where TASK[id_Indicator]=INDICATOR[id_Indicator]

 

but i don't know how....

Community Support Team
Community Support Team

Re: Calculated Column

HI @Roco ,

You can add filter conditions to task table based on current Indicator id:

 

ActualW =
CALCULATE (
    SUM ( Task[ActualValue] ),
    FILTER (
        ALL ( Task ),
        TASK[id_Indicator] = EARLIER ( Indicator[id_Indicator] )
    )
) * Indicator[weight]

Regards,

Xiaoxin Sheng

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



For learning resources/Release notes, please visit: | |
Roco Regular Visitor
Regular Visitor

Re: Calculated Column

@v-shex-msft thanks for the answer, but it didn't solve the problem yet, the values are still not correct.

I noticed that the metric ActualValue in Power BI is giving me the corret value by indicator (when i filter), but when i put the metric in the calculated column AtualValueW it gives me a diferent value (greater). I get the same value (greater) when i use the formula you suggested:

ActualW =
CALCULATE (
    SUM ( Task[ActualValue] ),
    FILTER (
        ALL ( Task ),
        TASK[id_Indicator] = EARLIER ( Indicator[id_Indicator] )
    )
) * Indicator[weight]

Why would that happen?

When i do the same operation with anonther value (column) of the table task it gives me correct results in the table Indicator...

Roco Regular Visitor
Regular Visitor

Re: Calculated Column

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

ActualValueW

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 ,

You can't use slicer/filter to dynamic change calculated column result, please use measure to instead.

Regards,

Xiaoxin Sheng

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



For learning resources/Release notes, please visit: | |

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: 35 members 950 guests
Please welcome our newest community members: