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

Group column values based on condition

As per screenshot of table below, in the "Job to Accep Elapsed Time (Days)" column, how do I group values greater than 10? Expected value when DAYS >= 10, show "10+" instead. Hope that makes sense.

@wdx223_Daniel @Jihwan_Kim - appreciate any suggestions

 

Screenshot 2021-10-14 123336.jpg

1 ACCEPTED SOLUTION

Hi,

Please check the below picture and the attached pbix file.

 

 

Picture1.png

 

Total jobs by group : =
CALCULATE (
[Total Jobs :],
FILTER (
VALUES ( Data[Category] ),
COUNTROWS (
FILTER (
GroupTable,
IF (
GroupTable[Max] <> BLANK (),
[Days :] >= GroupTable[Min]
&& [Days :] <= GroupTable[Max],
[Days :] >= GroupTable[Min]
)
)
) > 0
)
)

 

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

4 REPLIES 4
Jihwan_Kim
Super User
Super User

Hi, 

I do not know how your data model looks like, but check the below picture and the attached pbix file.

 

Picture1.png

 

Days by group : =
CALCULATE (
VALUES ( GroupTable[Group] ),
FILTER (
GroupTable,
IF (
GroupTable[Max] <> BLANK (),
[Days :] >= GroupTable[Min]
&& [Days :] <= GroupTable[Max],
[Days :] >= GroupTable[Min]
)
)
)

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Anonymous
Not applicable

@Jihwan_Kim   sorry I wasn't clear with my explanation and didn't provide enough information.

My expected result is to sum all jobs greater than 10 days into 10+ so as per screenshot sample below, the result will be (245+205+190+69+126+105) final result on table and chart will show 10+ = 940

Fyi the measures for the two columns in table:

TotalFailedJobsNextDay = CALCULATE(COUNTROWS('FreightForward v2'),FILTER('FreightForward v2','FreightForward v2'[BOOKING_BEFORE_AFTER_12]="AFTER 12" &&'FreightForward v2'[COMPLY_COMMENT]=BLANK() &&'FreightForward v2'[JOBCOUNT]=1))

=====================================================================================

Job to Accep Elapsed TIme Days = (DATEDIFF('FreightForward v2'[JOB_BOOKING_DATETIME],'FreightForward v2'[ACCEPTANCE_DATETIME],DAY ))

Hope that makes sense.

Screenshot 2021-10-15 110425.jpg

Hi,

Please check the below picture and the attached pbix file.

 

 

Picture1.png

 

Total jobs by group : =
CALCULATE (
[Total Jobs :],
FILTER (
VALUES ( Data[Category] ),
COUNTROWS (
FILTER (
GroupTable,
IF (
GroupTable[Max] <> BLANK (),
[Days :] >= GroupTable[Min]
&& [Days :] <= GroupTable[Max],
[Days :] >= GroupTable[Min]
)
)
) > 0
)
)

 

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Anonymous
Not applicable

@Jihwan_Kimawesome that worked as expected. Many thanks for your help, much appreciated

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.

Top Solution Authors