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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
simmi21
Frequent Visitor

Calculating calculated column on top of a measure and calculate column

Hi All, 

 

I am trying to create a conditional category based on below calculated column and measue:

Calculated Column
test = IFERROR(Max(0, 1-(DIVIDE('fc'[ABS_DEV],'fc'[Order]))),0)  
S/M = RELATED('mastertable'[S/M flag])
Measure
Acc-class = SWITCH(true(), AVERAGE('fc'[test]) >= .70 , "high", AVERAGE('fc'[test])>=.20, "medium", AVERAGE('fct'[test]) < .20, "low")
 
On top of Acc-Class and S/M, I want to create another category , something like below:
proposal sm = if(([Acc-class] = "high" || 'fc'[ABC Class] = "C"),"S", "M")
 
But I am getting below error.  -"There is not enough memory to complete the opertaion".
 
 simmi21_0-1621687234348.png

Any clue what should be I doing differently.

 

Thanks 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @simmi21 

I guess it may be caused by the inconsistency of the levels of your two association tables. I currently have no way to completely restore your tableOrders and tableMaster. I just made a simple association, and there is no problem after the data test .

tableMaster

Ailsa-msft_0-1622015825382.png

tableOrders

Ailsa-msft_1-1622015825383.png

Relationships between three tables

Ailsa-msft_2-1622015825386.png

The final result

Ailsa-msft_3-1622015825388.png

I have attached my pbix file, you can refer to it .

  

Best Regards

Community Support Team _ Ailsa Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi @simmi21 

I guess it may be caused by the inconsistency of the levels of your two association tables. I currently have no way to completely restore your tableOrders and tableMaster. I just made a simple association, and there is no problem after the data test .

tableMaster

Ailsa-msft_0-1622015825382.png

tableOrders

Ailsa-msft_1-1622015825383.png

Relationships between three tables

Ailsa-msft_2-1622015825386.png

The final result

Ailsa-msft_3-1622015825388.png

I have attached my pbix file, you can refer to it .

  

Best Regards

Community Support Team _ Ailsa Tao

 

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

I restored the scene according to your formula except that I don't understand Calculated Column S/M , the rest of the formula runs normally .

You created a calculated column S/M ,but I didnt see the column used in other formula , So are you sure that your error is due to the following formula ?

Ailsa-msft_0-1621932354582.png

My sample :

Ailsa-msft_1-1621932354583.png

And the measure and column I created

Measure :  Acc-class = SWITCH(true(), AVERAGE('fc'[test]) >= .70 , "high", AVERAGE('fc'[test])>=.20, "medium", AVERAGE('fc'[test]) < .20, "low")

Column :   test = IFERROR(Max(0, 1-(DIVIDE('fc'[ABS_DEV],'fc'[Order]))),0) 

                 COLUMN proposal sm = if(([Acc-class] = "high" || 'fc'[ABC Class] = "C"),"S", "M")

The effect is as shown :

Ailsa-msft_2-1621932354586.png

 

Best Regards

Community Support Team _ Ailsa Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Ailsa, 

 

You are right, what I meant was ABC class column not  S/M.

 

Let me share more details:

I have 3 table FC, Order, Master

FC is linked to Order table at Material & Month level. 

FC is linked to Master at Material level.

 

Here are the additional columns and measures created in FC table:

Calculated Column

Order = RELATED('orders'[order_snap])
ABC Class = RELATED('master'[ABC flag])
ABS_DEV = ABS('fc'[Forecast] - 'fc'[Order])
test = IFERROR(Max(0, 1-(DIVIDE('fc'[ABS_DEV],'fc'[Order]))),0) 
Measure
Acc-class = SWITCH(true(), AVERAGE('fc'[test]) >= .70 , "high", AVERAGE('fc'[test])>=.20, "medium", AVERAGE('fc'[test]) < .20, "low")

 

Now I am trying to create additional column proposal sm using a conditional logic based on Acc class and Abc Class and this is resulting in memory error.

= if(([Acc-class] = "high" || 'fc'[ABC Class] = "C"),"S", "M")

 

I am not sure, if it is too many calculated column at the back of this formula which is resullting in this issue(somethis which Power Bi doesn't allow), or simply I need to reduce the size of my data somehow.

Ashish_Mathur
Super User
Super User

Hi,

If you can describe your question, share some data and show the expected result, an alternative solution may be found out.  As suggested by @CNENFRNL, what you are trying to accomlish is not possible.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
CNENFRNL
Community Champion
Community Champion

You can reference calculated column in a measure but not the other way around, ie there's no way for measures to take effect in calculated columns.


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors