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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
wmeyer
Helper III
Helper III

grouping measure results

I have a matrix with a measure for Gross Profit %, and in another matrix i want to group the items in % ranges, and count the number of items in each. 

 

To calculate the gross profit % in the first matrix, i used:  Gross Profit% = CALCULATE(([Total Sales]-[Total Cost])/[Total Sales])  Total sales and total cost are measures to sum the columns in the sales order detail table. 

 

Here is the measure i tried to create for the new matrix, but it didnt work: GP% Category = COUNTAX('sales order detail',IF([Gross Profit%] <0, "-Negative", IF([Gross Profit%]>-1 && [Gross Profit%] <11, "0-10%", IF([Gross Profit%]>10 && [Gross Profit%]<21, "11-20%", IF([Gross Profit%]>20 && [Gross Profit%]<31, "21-30%", IF([Gross Profit%]>30 && [Gross Profit%]<61, "31-60%", IF([Gross Profit%]>60 && [Gross Profit%]<81, "61-80%", IF([Gross Profit%]>80, "81% and Higher", "Null"))))))))

 

 

Visual 1 is the matrix i have built, and visual 2 is what i want to build.

Current MatrixCurrent Matrix

Add'l matrix i want to createAdd'l matrix i want to create

1 ACCEPTED SOLUTION

@wmeyer,

 

You'll need to add a configuration table first.

https://www.daxpatterns.com/dynamic-segmentation/

Community Support Team _ Sam Zha
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

6 REPLIES 6
Anonymous
Not applicable

Hi @wmeyer. Did you ever figure this out? I am having to do the same thing with my data.

@Anonymous No, i didn't unfortunately. I struggled with it for awhile and then just gave up and moved on to other things. 

Anonymous
Not applicable

v-chuncz-msft
Community Support
Community Support

@wmeyer,

 

You may take a look at the following post.

http://community.powerbi.com/t5/Desktop/Variable-Range-based-on-date-filter/m-p/449496#M208072

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

Sam, Thank you for posting that, but unfortunately that doesn't get me where I'm trying to go. In that measure that was suggested, it is calculating the count from a column, however, I dont have that data in a column, and it is aggregted in a measure. I have a measure that is calculating the Gross Profit %, and the Gross Profit % calculated in the measure is what I am trying to count. Is it possible to count the output of values of a measure?

@wmeyer,

 

You'll need to add a configuration table first.

https://www.daxpatterns.com/dynamic-segmentation/

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

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.