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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
ashmitp869
Responsive Resident
Responsive Resident

Date field - sorting ascending issues due to null ?

Hi,

My date field is not sorting ascending as I got null.

ashmitp869_0-1746062685711.png



Expected result - 

ashmitp869_1-1746062707395.png

 

1 ACCEPTED SOLUTION
govind_021
Super User
Super User

Hi @ashmitp869 

To handle the sorting in your table visual and ensure blank rows appear last while sorting dates in ascending order, 
You can create a calculated column in your table that assigns a numeric value based on whether the date is blank or not. Here's an example DAX formula:

Step 1 - Create a sorting column using dates
SortOrder = IF(ISBLANK(Table[Date]), 1, 0)

This creates a column sort order where

  • Blank dates get a value of 1
  • Non-blank dates get a value of 0

    Step 2 - configure sorting in power bi
  1. Go to the Fields pane and select your Date column.
  2. Set the sort by column as the newly created Sort Order.
  3. In your table visual, include the Date field as usual. The blank rows will appear last, and the non-blank rows will sort in ascending order.

    Best Regards
    Govind Sapkade ( Microsoft Certified Data Analyst , PL 300 Certified , MS Fabric Enthusiast)
    Let's Connect
    Linkdin - www.linkedin.com/in/govind-sapkade-845104225
    Youtube - http://www.youtube.com/@govind_dataanalyst

View solution in original post

1 REPLY 1
govind_021
Super User
Super User

Hi @ashmitp869 

To handle the sorting in your table visual and ensure blank rows appear last while sorting dates in ascending order, 
You can create a calculated column in your table that assigns a numeric value based on whether the date is blank or not. Here's an example DAX formula:

Step 1 - Create a sorting column using dates
SortOrder = IF(ISBLANK(Table[Date]), 1, 0)

This creates a column sort order where

  • Blank dates get a value of 1
  • Non-blank dates get a value of 0

    Step 2 - configure sorting in power bi
  1. Go to the Fields pane and select your Date column.
  2. Set the sort by column as the newly created Sort Order.
  3. In your table visual, include the Date field as usual. The blank rows will appear last, and the non-blank rows will sort in ascending order.

    Best Regards
    Govind Sapkade ( Microsoft Certified Data Analyst , PL 300 Certified , MS Fabric Enthusiast)
    Let's Connect
    Linkdin - www.linkedin.com/in/govind-sapkade-845104225
    Youtube - http://www.youtube.com/@govind_dataanalyst

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.