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
Emranit
Helper I
Helper I

I need a DAX according to my requirements

 https://docs.google.com/spreadsheets/d/1H8aF0qeidZr2v0dxrJfaxx-kSbk0Kgcq/edit?usp=sharing&ouid=11391... 

 

I have a DAX which calculate the Maximum RunTime in Minutes among the 10 number of RunTime
from the Excel file.

Now I need a DAX which visualize that column Bulk_Production and Dyelot No according to maximum
RunTime. Like:-

## If maximum runtime 549 then visualize from same column
I] Bulk_Production 597
II] Dyelot 250890013

III] EndTime 18/8/2024

Can you do it from the link Excel file ?

 

Actually I need which Dyelot run maximum time, according to maximum runtime need Bulk_production quantity, Dyelot no & End Time. Then I'll able to understand why this dyelot need to run long time as we can calculate with the prduction & Date.

1 ACCEPTED SOLUTION
v-linyulu-msft
Community Support
Community Support

Thanks for the reply from FarhanJeelani , please allow me to provide another insight:

Hi, @Emranit 

Regarding the issue you raised, my solution is as follows:

1.First I have created the following table and the column names and data are the data you have given:

vlinyulumsft_0-1730796723684.png

2. Below are the measure I've created for your needs:

MaxDyelotNo = 
VAR MaxRunTime =CALCULATE( MAX('Table'[RunTime]),ALLSELECTED('Table'))
VAR maxno1=CALCULATE(MAX('Table'[Dyelot No]),FILTER('Table','Table'[RunTime]=MaxRunTime))
RETURN maxno1
Maxend = CALCULATE(
MAX('Table'[EndTime]),FILTER('Table','Table'[Dyelot No]=[MaxDyelotNo])
)
MaxBulkProductionRun = 
CALCULATE(
MAX('Table'[Bulk_Production]),FILTER('Table','Table'[Dyelot No]=[MaxDyelotNo])
)

3.Here's my final result, which I hope meets your requirements.

vlinyulumsft_1-1730796787480.png

Please find the attached pbix relevant to the case.

 

Best Regards,

Leroy Lu

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

4 REPLIES 4
v-linyulu-msft
Community Support
Community Support

Thanks for the reply from FarhanJeelani , please allow me to provide another insight:

Hi, @Emranit 

Regarding the issue you raised, my solution is as follows:

1.First I have created the following table and the column names and data are the data you have given:

vlinyulumsft_0-1730796723684.png

2. Below are the measure I've created for your needs:

MaxDyelotNo = 
VAR MaxRunTime =CALCULATE( MAX('Table'[RunTime]),ALLSELECTED('Table'))
VAR maxno1=CALCULATE(MAX('Table'[Dyelot No]),FILTER('Table','Table'[RunTime]=MaxRunTime))
RETURN maxno1
Maxend = CALCULATE(
MAX('Table'[EndTime]),FILTER('Table','Table'[Dyelot No]=[MaxDyelotNo])
)
MaxBulkProductionRun = 
CALCULATE(
MAX('Table'[Bulk_Production]),FILTER('Table','Table'[Dyelot No]=[MaxDyelotNo])
)

3.Here's my final result, which I hope meets your requirements.

vlinyulumsft_1-1730796787480.png

Please find the attached pbix relevant to the case.

 

Best Regards,

Leroy Lu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Yes, I got the solution. You are really great. Thanks....Thanks

FarhanJeelani
Solution Supplier
Solution Supplier

To fulfill your requirement in Power BI using DAX, where you want to retrieve the "Bulk_Production," "Dyelot No," and "EndTime" based on the maximum "RunTime," you can use the following approach:

 

1. Calculate the Maximum RunTime
First, create a measure to find the maximum runtime:
DAX
MaxRunTime = MAX('YourTable'[RunTime])

2. Filter Dyelot based on MaxRunTime
Next, create a measure to retrieve the "Bulk_Production," "Dyelot No," and "EndTime" associated with this maximum runtime:
DAX
BulkProductionMaxRun =
CALCULATE(
SELECTEDVALUE('YourTable'[Bulk_Production]),
'YourTable'[RunTime] = [MaxRunTime]
)

DyelotNoMaxRun =
CALCULATE(
SELECTEDVALUE('YourTable'[Dyelot No]),
'YourTable'[RunTime] = [MaxRunTime]
)

EndTimeMaxRun =
CALCULATE(
SELECTEDVALUE('YourTable'[EndTime]),
'YourTable'[RunTime] = [MaxRunTime]
)

Replace `'YourTable'` with the actual name of your table in Power BI.

This setup will allow you to display the maximum runtime details on a card or in a table visualization in Power BI. Let me know if you need further adjustments or if you can share any other details about the data structure!

 

 

Please mark this as solution. appreciates Kuos

I'm unable to understand RunTime. If I put RunTime in Minutes replace of RunTIme, it's showing below error. It's happening for DyelotNoMaxRun & EndTimeMaxRun. Please need your help again.

 

BulkProductionMaxRun =
CALCULATE(
SELECTEDVALUE('YourTable'[Bulk_Production]),
'YourTable'[RunTime] = [MaxRunTime]
)

DyelotNoMaxRun =
CALCULATE(
SELECTEDVALUE('YourTable'[Dyelot No]),
'YourTable'[RunTime] = [MaxRunTime]
)

EndTimeMaxRun =
CALCULATE(
SELECTEDVALUE('YourTable'[EndTime]),
'YourTable'[RunTime] = [MaxRunTime]
)

 

Emranit_0-1730808657977.png

 

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!

November Carousel

Fabric Community Update - November 2024

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

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.