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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
bidevsugmen
Resolver I
Resolver I

DAX: Calculate MAX of a measure in a subgroup

Hello Everyone,

 

I'm facing the issue as mentioned below-

Sample data:

4-12.png

 

 

 

 

I am facing difficulty in developing the logic for "occupancy as per bottleneck reactor" as a calculated measure in Power BI.

Using MAXX(Table, Table[Total Hr Occupancy]) gives me same values as in the column Total Hr Occupancy, instead of picking up the respective max values.

 

What if parameters - Stage ratio and Batch size

Kg/Hr = [Stage ratio]*[Batch size]*[Eq. ratio] / [Std time per batch]     ([Eq. ratio]  and [Std time per batch] are input fields not mentioned in the sample data)

Kg = input field

[Total Hr Occupancy] = Kg / [Kg/Hr]

 

Any help would be appreciated.

 

Thanks in advance,

Suguna.

 

 

 

1 ACCEPTED SOLUTION

Hi @bidevsugmen,

 

Maybe you can try to use following formula, this measure will change by what if parameter:

Kg/Hr = MAX('U-3'[Stage ratio])*[Batch Size Value]*MAX('U-3'[Eq. API ratio]) / MAX('U-3'[Std. Time/batch (hrs)])

Total Hr Occupancy = [Batch Size Value]/[Kg/Hr]

 

Regads,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

5 REPLIES 5
v-shex-msft
Community Support
Community Support

HI @bidevsugmen,

 

Can you please share a pbix file wiht some sample data and expected result to help us clarify your requirement? It will be help for us to test and coding formula.

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Hi @v-shex-msft

 

You can download the pbix file from here. It also has the Excel sheet which is the data source and a notepad file which consists of the formulae that we ahev already tried.

The column header highlighted in purple in table Product wise parameter is the point of discussion here.

 

Thanks,

Suguna.

Hi @bidevsugmen,

 

Maybe you can try to use following formula, this measure will change by what if parameter:

Kg/Hr = MAX('U-3'[Stage ratio])*[Batch Size Value]*MAX('U-3'[Eq. API ratio]) / MAX('U-3'[Std. Time/batch (hrs)])

Total Hr Occupancy = [Batch Size Value]/[Kg/Hr]

 

Regads,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Anonymous
Not applicable

Try this

 

measure =
MAXX ( VALUES ( Table[Grouping key] ), Table[Total Hr Occupancy] )

you could replace the table[total hr occupancy] with an equivialnt measure, which might be better as calculated columns wont respond to changes in what if parameters in the same way as measures do.

Hi @Anonymous

 

I tried implementing your suggestion but did not get expected result. It produces the same values as Total Hrs Occupancy.

 

 

image.png

 

 

 

Thanks,

Suguna.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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