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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
AbdulRahman86
Frequent Visitor

DAX formula or any other alternate

Hello Team,

I really required your kind help on below request. I just attached screeshot . need expected results as in the form of  table in Report view of  power bi desktop. 

 

AbdulRahman86_0-1751044242395.png

 

13 REPLIES 13
AbdulRahman86
Frequent Visitor

Hello All,

 

Attached sample data with expected results. 

 

https://drive.google.com/file/d/1i_IC6XwMMdTtvq5SjLeaR38ny9eIJifJ/view?usp=drive_link 

AbdulRahman86
Frequent Visitor

Hello All, 
I m trying my best to share sample data here , i have data like first table,  need out put as shown in output table . 

BU IDStatus 1Status 2Start Time Output for for Each BU ID  
1AB27-06-2025 10:54   Difference in mins
1AB27-06-2025 11:54 min of A and B 27-06-2025 10:54 
1AB27-06-2025 13:54 Min of E and F27-06-2025 11:540.041671181
1EF27-06-2025 11:54    
1EF27-06-2025 12:54 Min of E and F27-06-2025 11:54 
1CD28-06-2025 11:54 Max of E and F27-06-2025 12:540.041662153
2AB27-06-2025 19:54    
2AB27-06-2025 11:54 Max of E and F27-06-2025 12:54 
2CD28-06-2025 11:54 min of C and28-06-2025 11:540.958333333
2CD27-06-2025 22:06    
2AB27-06-2025 11:54    
        

Hi @AbdulRahman86,

Thank you for reaching out to the Microsoft fabric community forum.  I reproduced the scenario again, and it worked on my end. I used my sample data and successfully implemented it. Used line chart.

outcome:

vkpolojumsft_0-1751535778729.png


I am also including .pbix file for your better understanding, please have a look into it:

If this post helps, then please give us ‘Kudos’ and consider Accept it as a solution to help the other members find it more quickly.

Thank you for using Microsoft Community Forum.

Hi @AbdulRahman86,

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

Thank you.

 

Hi @AbdulRahman86,

Hope you had a chance to try out the solution shared earlier. Let us know if anything needs further clarification or if there's an update from your side always here to help.

Thank you.

Hi @AbdulRahman86,

Just wanted to follow up one last time. If the shared guidance worked for you, that’s wonderful hopefully it also helps others looking for similar answers. If there’s anything else you'd like to explore or clarify, don’t hesitate to reach out.

Thank you.

v-kpoloju-msft
Community Support
Community Support

Hi @AbdulRahman86,

Thank you for reaching out to the Microsoft fabric community forum. Also thanks to @Ashish_Mathur@danextian@Greg_Deckler, I reproduced the scenario, and it worked on my end. I used my sample data and successfully implemented it.

After loading the sample data into Power BI using the Text/CSV import option, open the Power Query Editor by selecting Transform Data. Ensure that the Start Time column is correctly recognized as a Date/Time type. Next, perform a grouping operation by selecting the BU ID, Status 1, and Status 2 columns. In the Group By dialog, configure it to compute two new columns: one that returns the earliest (Min) Start Time, and another that returns the latest (Max) Start Time within each group.

Once the data is grouped, create a new column to calculate the duration between the earliest and latest Start Time values. This can be done by adding a custom column with the formula:

Duration.Hours([Max Start Time] - [Min Start Time])

Rename Min Start Time to Start Time, Max Start Time to End Time, and Custom to Difference in Hours. Once the transformations are complete, click Close & Apply to load the grouped and calculated results into your Power BI model. You can now create a table visual with BU ID, Status 1, Status 2, Start Time, End Time, and Difference in Hours to match the expected output.

outcome:

vkpolojumsft_0-1751279074653.png


I am also including .pbix file for your better understanding, please have a look into it:

If this post helps, then please give us ‘Kudos’ and consider Accept it as a solution to help the other members find it more quickly.

Thank you for using Microsoft Community Forum.

danextian
Super User
Super User

Hi @AbdulRahman86 

 

You didnt tell us how to arrive to those results? What is the logic? How to calculate them? Also, what are the highlights for?





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Hi , 

 

Here is problem statement, we have different set of BU ids, every BU ids contains status1 and status2, with duplicate status , so I want to find out max date and time stamp of same this combination "Status A and Status B" then for same Status A and Status B need to find out Min date and time stamp  , once we got max and min for these status , need to find out difference in hours. 

 

That's it.

I hope it s clear. 

 

thanks for your time. 

 

AbdulRahman86
Frequent Visitor

Hello Greg,

 

Thanks for guiding, 

 

As you requested, I have uploaded sample data in the form of table 

and shown expected results also.

 

Could you please help me. 

 

AbdulRahman86
Frequent Visitor

Column1Column2Column3Column4Column5Column6Column7Column8Column9Column10Column11
BU IDStatus 1Status 2Start TimeRAWDATA      
1AB27-06-2025 10:54       
1CD27-06-2025 11:54       
1AB27-06-2025 11:54       
1EF27-06-2025 11:54       
1CD27-06-2025 12:54       
1CD27-06-2025 11:54       
1AB27-06-2025 13:54       
2AB27-06-2025 19:54       
2CD27-06-2025 23:54       
2AB27-06-2025 11:54       
2CD28-06-2025 11:54       
2CD27-06-2025 22:06       
2AB27-06-2025 11:54       
Below is expected Results          
BU IDStatus 1Staus 2Start TimeEnd TimeDifference in hoursStatus 1Staus 2Start TimeEnd TimeDifference in hours
1AB27-06-2025 10:5427-06-2025 13:543.00CD27-06-2025 11:5427-06-2025 12:541.00
2AB27-06-2025 19:5427-06-2025 22:062.20CD27-06-2025 23:5428-06-2025 11:5412.00

Hi,

If you want to do it with DAX measures, then you may not get your desired structure but you will get the correct result.  To a table visual, drag BU ID, Status 1 and Status 2 to the row labels.  Write these measures

Min = min(Data[Start time])

Max = max(Data[Start time])

Diff = [max]-[min]

Hope this helps.


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

@AbdulRahman86 Sorry, having trouble following, can you post sample data as text and expected output?
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882

Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

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 community update carousel

Fabric Community Update - June 2025

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