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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
juanesteban14
New Member

How to convert a measure into a column and then use it as an attribute to re-calculate measures.

Hi to all, I'would appreciate if someone could help me to solve this:
I have a sales report that include SKU / Customer / Sales Quantity / Margin% and I need to classify in four cathegories my SKUs, to do that I create a Parameter for each measure to define the target number for each measure, Quantity and Margin.  Based on those targets and real numbers, I've create a new column calculated, to categorize this two measeure in one, I mean, cathegory A, B, C and D, where, Cat A is when Quantity and Margin are higher than Targets parameters,  Cat B is when Quantity is higher than Quanty Target and margin is lower than margin target.  Cat C is when Quantity is lower than Quanty Target and margin is higher than margin target and Cat D is when Quantity and Margin are lower than Targets parameters.

The issue that I have is when I try to use this new column as an attribute, because based on that cathegory (A, B, C, D) I want to recaclulate quantities, margins and numbers of SKUs for each category A, B,C and D.  Something like this:

Thanks, 

 

juanesteban14_0-1741386944758.png

 

1 ACCEPTED SOLUTION

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you provided.

Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

View solution in original post

8 REPLIES 8
v-ssriganesh
Community Support
Community Support

Hi @juanesteban14,
Could you please confirm if this issue has been resolved? If it has, kindly mark it as the solution and share the details in the community to help other members.
Thank you.

v-ssriganesh
Community Support
Community Support

Hi @juanesteban14,

I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.

juanesteban14
New Member

Thanks for your comments.

v-ssriganesh
Community Support
Community Support

Hi @juanesteban14,

Thank you for posting your query in the Microsoft Fabric Community Forum.

 

May I ask if you have resolved this issue? If so, please mark it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

Thank you.

 

Anonymous
Not applicable

Hi @juanesteban14 ,

 

According to your description, categories are reached by measure. You can create a table with all the categories, use this column in the visualization and calculate data such as the total quantity of each category in the fact table by the measure.

 

Here is my test for your reference.

Custom Table.

Table 2 = DATATABLE("Category",STRING,{{"A"},{"B"},{"C"}})

Measure.

quantity = SUMX(FILTER('Table',[Categories]=MAX('Table 2'[Category])),'Table'[Value])

vmengmlimsft_0-1741591519713.png

vmengmlimsft_1-1741591533599.png

 

 

 

 

——————————————————————————————————————————————————

If my answer helps you solve the problem, please accept my answer as a solution and let it be seen by more people in need.

 

Best regards,

Mengmeng Li

Thanks for taking the time to answer and send me this option. I've tried to implemented but I couldn't, I don´t know if I'm doing wrong but calculations are not right. I'll try to do it again from scratch. Thanks.

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you provided.

Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

lbendlin
Super User
Super User

Calculated columns are immutable. You cannot base them on measures.

 

Power BI does not support dynamic binning.  You need to bring your own buckets.

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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