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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
efstel
Helper I
Helper I

Group Values in a within a Calcuated Measure

I know I can't do this, but I'm sure there is a work around but I can't figure it out. So here's the deal:

I have two large sets of data tables. One has costs ('JCCD'[ActualCost]) and the other billings ('JCID'[BilledAmt]). I'm doing a simple division measure to determine the % difference. Both data sets have a "JobNumber" associated with each line of cost and billings. I can aggregate all the costs and billing from each JobNumber together and get the % difference no problem via:

ActualCost divided by BilledAmt = DIVIDE(SUM('JCCD'[ActualCost]), SUM('JCID'[BilledAmt]))
I would like to group the values in groups of 5% or so so I can see how many (count) "JobNumber"s fall into each group. For example, 80%-85%, 85%-90%, 90%-95%,...
Any suggestions?

 
3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

You may refer to my solution to a similar problem in the attached files.  Please study/review the files and adapt the techniques/measures to your data.

Hope this helps.


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

Appreicate it @Ashish_Mathur and @RossEdwards. Both of these solutions partially work, but what I need is for the query to influence the table when the visual is clicked. For example, if I have a bar on a bar chart showing the 90%-95% and if I were to click on that bar I would want it to query the table to only show the 90% - 95% group. Currently now I'm getting the following.  It's just toggling the text off and on.

 

efstel_1-1711995207546.pngefstel_2-1711995239906.png

 

 

 

 

 

RossEdwards
Solution Sage
Solution Sage

Try something like this:

 

ActualCost divided by BilledAmt Grouped = var resultValue = [ActualCost divided by BilledAmt]
RETURN
SWITCH(
    TRUE,
    resultValue < 0.05, "0% - 5%",
    resultValue < 0.1, "5% - 10%",
.
.
.
    resultValue < 0.9, "90% - 95%",
    "95% - 100%"
)

(note, those dotted rows are so i dont have to write the whole thing out in my illustration. You will have to)

 

Helpful resources

Announcements
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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.