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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Anonymous
Not applicable

Create a calculated column using another calculated column

Hi,

 

I'm confronting a problem that I'm not able to solve. I request your help on this. 

 

I created a column by using the formula

Impact_Mean= calculate(SUM(Append1[Total Impact])/SUM(Append1[Weight]),ALLEXCEPT(Append1,Append1[RiskName]))

which is total sum of impact divided by total sum of weight categorized by risk name. 

 

Similarly, Probability_Mean is calculated.

Probability_Mean= calculate(SUM(Append1[Total Probability])/SUM(Append1[Weight]),ALLEXCEPT(Append1,Append1[RiskName]))

 

Now I would like to create another calculated column using these two calculated columns i.e. 

TEST = Switch(TRUE(),
Append1[Impact_Mean]=4 && Append1[Probability_Mean]=4,"4",
Append1[Impact_Mean]=4 && Append1[Probability_Mean]=3,"1",
Append1[Impact_Mean]=5 && Append1[Probability_Mean]=5,"2",
"0")
 
Test is the final calculated column that does not show any error but the result of Test column is always coming out to be 0 even after the condition is true. Test column is not giving the right results. 
 
I request your advice on the issue confronted. 
 
Thank you in advance. 
 
 
1 ACCEPTED SOLUTION
Samarth_18
Community Champion
Community Champion

Hi @Anonymous ,

 

Could you please try below code:-

TEST =
SWITCH (
    TRUE (),
    TRUNC ( Append1[Impact_Mean] ) = 4
        && TRUNC ( Append1[Probability_Mean] ) = 4, "4",
    TRUNC ( Append1[Impact_Mean] ) = 4
        && TRUNC ( Append1[Probability_Mean] ) = 3, "1",
    TRUNC ( Append1[Impact_Mean] ) = 5
        && TRUNC ( Append1[Probability_Mean] ) = 5, "2",
    "0"
)

BR,

Samarth

 

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

View solution in original post

6 REPLIES 6
Samarth_18
Community Champion
Community Champion

Hi @Anonymous ,

 

Could you please try below code:-

TEST =
SWITCH (
    TRUE (),
    TRUNC ( Append1[Impact_Mean] ) = 4
        && TRUNC ( Append1[Probability_Mean] ) = 4, "4",
    TRUNC ( Append1[Impact_Mean] ) = 4
        && TRUNC ( Append1[Probability_Mean] ) = 3, "1",
    TRUNC ( Append1[Impact_Mean] ) = 5
        && TRUNC ( Append1[Probability_Mean] ) = 5, "2",
    "0"
)

BR,

Samarth

 

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Anonymous
Not applicable

Hi,

 

Thank you for the suggestion. It is giving me Non-Zero values in Column "Test" but these values are not correct as per the condition applied

gupta_diksha_0-1653462751925.png

gupta_diksha_1-1653462787288.png

Thank you in advance

@Anonymous Is it possible for you to share your PBIX file after removing sensitive data?

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Anonymous
Not applicable

After correcting the data type and applying Trunc, It is working fine now. 

Thank you very much for your help.

SpartaBI
Community Champion
Community Champion

@Anonymous can you share a screenshot of the table with these calculated columns and their result.

Anonymous
Not applicable

Sure. 

gupta_diksha_0-1653460853169.png

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.