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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello,
I keep getting this error - I am truing to sort customer lifespan by days active - however it keeps coming up with this error above.
Can anyone help me with this issue?
The calculated column is in dax -->
years_months_days_active =
VAR days = dim_account[Query1.days_active]
VAR years = ROUNDDOWN(days / 365, 0)
VAR days_remainder_year = MOD(days, 365)
VAR months = ROUNDDOWN(days_remainder_year / 30, 0)
VAR days_remainder_months = MOD(days_remainder_year, 30)
RETURN
SWITCH(
TRUE(),
days = BLANK() || days_remainder_months = 0, BLANK(),
years = 0 && months = 0, days_remainder_months & "d",
years = 0, months & "m " & days_remainder_months & "d",
years & "y " & months & "m " & days_remainder_months & "d"
)
Hi @gussie ,
I used your calculated column and created the following data:
1. Click [customer lifespan], select Column tools – Sort by column – [Query1.days_active]
2. Result:
My data will be sorted correctly
Is your Power bi Desktop version the latest version, can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@gussie , this means you have one value for which you have more than one sort index.
Refer my video where I discussed these issues: https://www.youtube.com/watch?v=KK1zu4MBb-c
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 41 | |
| 37 | |
| 35 | |
| 35 | |
| 28 |
| User | Count |
|---|---|
| 134 | |
| 101 | |
| 71 | |
| 67 | |
| 65 |