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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
skazaryan
Frequent Visitor

Days Group DAX Function

Hi, Can you please help me with DAX formulas, I kinda stuck. 

 

I have START Date and END Date and need to calculate Days Between, I used this function below to create new column:

Days = DATEDIFF([START_DATE],[END_DATE],DAY)
Then I need to group them into categories, this is what I Use to create a new column:
Days Group = if([Days] = 0, "0 Day" , if([Days] = 1, "1 Day", if([Days]  = 2, "2 Days", if([Days] = 3, "3 Days", if([Days] = 4, "4 Days", if([Days] = 5, "5 Days", if([Days] >= 6, "6+ Days", IF(ISBLANK([Days]),BLANK(), "Pending" ))))))))
The problem is, that all my Blank Values capchuring under 0 Days Categorie, insted of Pendings. 
What should I fix in order to get me blanks under "Pendings"?
Also, my new column days is a number type, but if I change it to text then "pending" is working, but my other groups are getting messy. 
 
Please advice. 
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @skazaryan

Please try to create one calculated column as below:

Days Group = IF ( ISBLANK ( [Days] ), "Pending", IF ( [Days] >= 6, "6+", [Days] ) & " Days" )

datediff.JPG

If the above formula is not applicable in your scenario, could you please explain which condition can be grouped as " Pending "?

 

Best Regards

Rena

View solution in original post

4 REPLIES 4
skazaryan
Frequent Visitor

Thank you, everyone, for the help!

Anonymous
Not applicable

Hi @skazaryan

Please try to create one calculated column as below:

Days Group = IF ( ISBLANK ( [Days] ), "Pending", IF ( [Days] >= 6, "6+", [Days] ) & " Days" )

datediff.JPG

If the above formula is not applicable in your scenario, could you please explain which condition can be grouped as " Pending "?

 

Best Regards

Rena

az38
Community Champion
Community Champion

Hi @skazaryan 

try to use grouping technique as described here https://docs.microsoft.com/en-us/power-bi/desktop-grouping-and-binning


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
vivran22
Community Champion
Community Champion

Hello @skazaryan 

 

I would recommend to use Power Query for this:

 

Add a custom column:

1.PNG

 

Change the column type to number:

2.png

 

Add a conditional column:

3.PNG

 

Result:

4.PNG

 

Cheers!
Vivek

If it helps, please mark it as a solution
Kudos would be a cherry on the top 🙂

https://www.vivran.in/

Connect on LinkedIn

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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