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

Calculated whole number doesnt sort correctly in matrix

Hi,

 

I have a calculated column with the dax expression and the whole number data type

 

 

 

Days Past = DATEDIFF(INVOICE[PAYMENT_DUE_DATE],TODAY(),day)

 

 

 

If I set this as the first row header in a matrix and click the down arrow to sort it shows

 

66

62

6

5

4

37

35

 

Instead of sort it by number values ...any ideas?

 

Thanks

1 ACCEPTED SOLUTION
v-yanjiang-msft
Community Support
Community Support

Hi @Anonymous ,

According to your description, I create a sample and can't reproduce your problem.

vkalyjmsft_0-1657702923426.png

Please try to sort the Days Past column by the PAYMENT_DUE_DATE column. Click the Days Past column > Sort by column > PAYMENT_DUE_DATE.

vkalyjmsft_1-1657703057972.png

Best Regards,
Community Support Team _ kalyj

If this post helps, then please considerAccept it as the solution to help the other members find it more quickly.

 

View solution in original post

3 REPLIES 3
v-yanjiang-msft
Community Support
Community Support

Hi @Anonymous ,

According to your description, I create a sample and can't reproduce your problem.

vkalyjmsft_0-1657702923426.png

Please try to sort the Days Past column by the PAYMENT_DUE_DATE column. Click the Days Past column > Sort by column > PAYMENT_DUE_DATE.

vkalyjmsft_1-1657703057972.png

Best Regards,
Community Support Team _ kalyj

If this post helps, then please considerAccept it as the solution to help the other members find it more quickly.

 

amitchandak
Super User
Super User

@Anonymous , Make sure the data type and format both are the whole numbers.

 

You can sort on row/Measure. Column will sort based on the sort order of column used

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hi @amitchandak ,

 

Both are set as whole number and is a in the matrix as a ROW?

 

Capture.PNG

 

TIA

Helpful resources

Announcements
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!

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.