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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Anonymous
Not applicable

CREATE A RANGE FROM MEASURE

Hello I need some help plis

 

I have  this measure

CUMPLIMIENTO = CALCULATE(DIVIDE(CONSOLIDADO[RGU],[SUMmeta]))
the result  is the percentage of compliance.
Captura de pantalla 2024-09-03 150815.jpg
 
NOW  I need get a range to know the lowest,medium and highest percentage of compliance and put it in a filter
 
 I try add a column whit these measures
Rangos = SWITCH(TRUE(),[CUMPLIMIENTO]< 0.50,"BAJO",[CUMPLIMIENTO]>=0.50 && [CUMPLIMIENTO]<0.80,"MEDIO",[CUMPLIMIENTO]>=0.80,"ALTO")
 
AND
 
Rango cumplimiento = IF('METAS POR AGENTE'[CUMPLIMIENTORGUAGE]<0.5,"BAJO",IF('METAS POR AGENTE'[CUMPLIMIENTORGUAGE]>=0.8,"ALTO","MEDIO"))
 
But none of them worked
 
example; I choose "BAJO", but the result in not correct.
Captura de pantalla 2024-09-03 150546.jpg
 
I need add something more? I don´t know
 
Can someone help me plis.
 
 
2 ACCEPTED SOLUTIONS
lbendlin
Super User
Super User

You cannot measure a measure directly. Either materialize it first, or create a separate measure that implements the entire business logic.

View solution in original post

Anonymous
Not applicable

Hello,lbendlin ,thanks for your concern about this issue.

Your answer is excellent!
And I would like to share some additional solutions below.


Hi,@Anonymous.I am glad to help you.

According to your description, you are trying to use measure in the process of creating a calculated column.
In fact, as lbendlin mentioned, it is generally not recommended to refer to measure when creating calculated columns.
This can lead to some problems related to the fact that they have different effective times.
The time when measure takes effect is when there is an obvious environment for the calculation (putting the measure into a visual).
This is when measure calculates the results.

The calculate column is loaded when the report is refreshed and it takes up memory space, whereas the measure does not and the measure is a scalar value.
I ran the following test

This is my test data.

vjtianmsft_0-1725512797412.png

I first created a measure, and created the first calculated column from this measure (which works fine)
All the columns and measure data used in both dax codes are from the same table 'data_refreshTest'.
No other table data is involved

vjtianmsft_1-1725512821359.png

The first valid calculated column created

vjtianmsft_2-1725512854866.png
The problem arises when I try to create another calculated column using another measure

vjtianmsft_3-1725513534830.png

 

M_useOtherTableMeasure = 
IF('data_refreshTest'[M_FilterTimeID]="small",1,2)

 

The measure is dependent on a previously created measure, and the creation of a second calculated column has a circular dependency problem that prevents it from displaying properly.

vjtianmsft_4-1725513609172.png

In fact, even though all measures in a report model are shared (they do not belong to a specific table), the problem is that the computed columns and measures have different computation logic, and it is not recommended to apply other measures when creating computed columns.
But the problem is that the calculation logic of the calculated columns and measures are not the same, it is not recommended to create calculated columns when applying other measures, which has a greater risk:
1. Easy to have circular dependencies and other problems
2. The calculation logic that can be realized must be simple.
3. metrics are computed in the filtering context, while computed columns are computed in the row context. This mixing may lead to computational inefficiencies.
If you do need to refer to the metric in the calculated column, it is recommended that you try to optimize the formula to make the calculation logic of the measure used simple and to ensure that it does not have a disproportionate impact on performance. Typically, measures are better suited for dynamic calculations and aggregation in reports, while calculated columns are better suited for static calculations and data preprocessing.
Instead of [Rangos] (the metrics you use in your calculated columns), I recommend creating calculated columns that accomplish the same thing.
Their computational environments can be kept as identical as possible, minimizing performance issues and error reporting.
Here's the link in question, hopefully it helps
URL:
Solved: Using a Measure in a Calculated Column - Microsoft Fabric Community

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.

Best Regards,

Carson Jian

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hello,lbendlin ,thanks for your concern about this issue.

Your answer is excellent!
And I would like to share some additional solutions below.


Hi,@Anonymous.I am glad to help you.

According to your description, you are trying to use measure in the process of creating a calculated column.
In fact, as lbendlin mentioned, it is generally not recommended to refer to measure when creating calculated columns.
This can lead to some problems related to the fact that they have different effective times.
The time when measure takes effect is when there is an obvious environment for the calculation (putting the measure into a visual).
This is when measure calculates the results.

The calculate column is loaded when the report is refreshed and it takes up memory space, whereas the measure does not and the measure is a scalar value.
I ran the following test

This is my test data.

vjtianmsft_0-1725512797412.png

I first created a measure, and created the first calculated column from this measure (which works fine)
All the columns and measure data used in both dax codes are from the same table 'data_refreshTest'.
No other table data is involved

vjtianmsft_1-1725512821359.png

The first valid calculated column created

vjtianmsft_2-1725512854866.png
The problem arises when I try to create another calculated column using another measure

vjtianmsft_3-1725513534830.png

 

M_useOtherTableMeasure = 
IF('data_refreshTest'[M_FilterTimeID]="small",1,2)

 

The measure is dependent on a previously created measure, and the creation of a second calculated column has a circular dependency problem that prevents it from displaying properly.

vjtianmsft_4-1725513609172.png

In fact, even though all measures in a report model are shared (they do not belong to a specific table), the problem is that the computed columns and measures have different computation logic, and it is not recommended to apply other measures when creating computed columns.
But the problem is that the calculation logic of the calculated columns and measures are not the same, it is not recommended to create calculated columns when applying other measures, which has a greater risk:
1. Easy to have circular dependencies and other problems
2. The calculation logic that can be realized must be simple.
3. metrics are computed in the filtering context, while computed columns are computed in the row context. This mixing may lead to computational inefficiencies.
If you do need to refer to the metric in the calculated column, it is recommended that you try to optimize the formula to make the calculation logic of the measure used simple and to ensure that it does not have a disproportionate impact on performance. Typically, measures are better suited for dynamic calculations and aggregation in reports, while calculated columns are better suited for static calculations and data preprocessing.
Instead of [Rangos] (the metrics you use in your calculated columns), I recommend creating calculated columns that accomplish the same thing.
Their computational environments can be kept as identical as possible, minimizing performance issues and error reporting.
Here's the link in question, hopefully it helps
URL:
Solved: Using a Measure in a Calculated Column - Microsoft Fabric Community

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.

Best Regards,

Carson Jian

lbendlin
Super User
Super User

You cannot measure a measure directly. Either materialize it first, or create a separate measure that implements the entire business logic.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.