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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
BarathM
New Member

Need Help : Data Grouping by Duration and Process

Hi

    I need some help. I am newbie to Power Bi. I have data table as shown below.  I would like to add a new column to calculate the duration differents between "End Date" - "Start Date" in days.

 

1. Then I would like to group the the data by durations in day. This is for 1st scenario. For example,

< 0 day 

> 1 day and < 2 day

> 2 day and < 3 day

 

2. I also would like to do grouping like how many times  units when thru how many Process steps. This is the second scenario.

 

Unit IdStart DateEnd DateProcess
18/4/2020 23:598/5/2020 17:21BT
28/4/2020 13:498/4/2020 18:05BT
38/3/2020 21:248/4/2020 8:14BT
48/3/2020 16:138/4/2020 2:28BT
58/3/2020 12:278/4/2020 8:07BT
28/3/2020 10:198/3/2020 11:13Proscan
38/3/2020 7:458/4/2020 2:11Proscan
18/2/2020 19:498/3/2020 18:43Proscan
18/2/2020 9:188/3/2020 11:27FT
18/2/2020 9:058/3/2020 11:06BT
58/1/2020 14:108/3/2020 11:27Proscan

 

Thank you

3 REPLIES 3
v-juanli-msft
Community Support
Community Support

Hi @BarathM 

1. 

create calculated columns

 

duration = DATEDIFF([Start Date],[End Date],DAY) 

groupbyduration =
SWITCH (
    TRUE (),
    [duration] <= 0, "<=0 day",
    [duration] >= 1
        && [duration] < 2, ">=1 and <2 day",
    [duration] >= 2
        && [duration] < 3, ">=2 and  day"
)

 

Capture5.JPG

 

2.

"do grouping like how many times  units when thru how many Process steps",

what does this mean?

does it group by units or process steps?

count time diff or different units?

 

If you need to count units grouped by process, create a measure like this

Measure = CALCULATE(COUNT('Table 3'[Unit Id]),ALLEXCEPT('Table 3','Table 3'[Process]))

Capture6.JPG

 

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Greg_Deckler
Community Champion
Community Champion

@BarathM - See my article on Mean Time Between Failure (MTBF) which uses EARLIER: http://community.powerbi.com/t5/Community-Blog/Mean-Time-Between-Failure-MTBF-and-Power-BI/ba-p/3395...



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

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.