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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Emranit
Helper II
Helper II

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
Anonymous
Not applicable

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
Anonymous
Not applicable

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
Super User
Super User

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

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.