Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreThe FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now
Hello,
I need to create a Matrix report that show 6 months of data, then totals everything beyond 6 months.
I have sucessfully created a calculated column that does this.
I need to figure out either 1) how to sort the _MonthYear column chronologically, or 2) how to hide columns greater than 6 months out but still keep the Total column.
The error I get when trying to sort the _MonthYear column is this:
Appreciate any help!
Solved! Go to Solution.
To sort chronologically, you need to create a new integer column. This could be something like:
Month Sort Column = SWITCH('Calendar'[MonthYear], "Beyond 6 Months", 9999999, FORMAT('Calendar'[MonthYear], "yyyymm") // e.g. Apr-2025 should give you 202504
then select your original Month-Year column and sort using the above.
Otherwise, you could try something like:
Table Measure = IF(HASONEVALUE(Calendar[MonthYear]), [Your normal calculation], [Your calculation for the total])
Hi @gdaniel please try this
In Power Query, add an Index Column to your Calendar table and name it _MonthYearIndex.
In Data View, select _MonthYear and sort it by _MonthYearIndex.
To sort chronologically, you need to create a new integer column. This could be something like:
Month Sort Column = SWITCH('Calendar'[MonthYear], "Beyond 6 Months", 9999999, FORMAT('Calendar'[MonthYear], "yyyymm") // e.g. Apr-2025 should give you 202504
then select your original Month-Year column and sort using the above.
Otherwise, you could try something like:
Table Measure = IF(HASONEVALUE(Calendar[MonthYear]), [Your normal calculation], [Your calculation for the total])
Thanks @vicky_ , I created a column like this, and it works to create the correct data in the column:
However, when I try to sort my _MonthYear column with this new _Sort2 column, I get a very unhelpful error message 😞
I will keep working on this, and post a solution if I find one.
Update - the sort column solution above worked! I researched the validation error message I received, and was able to resolve it by doing this:
Thanks again @vicky_
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 9 | |
| 6 | |
| 3 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 21 | |
| 14 | |
| 11 | |
| 6 | |
| 5 |