How to set a "Sort by column" dynamically


#1

Hi,

I was looking for a solution to easily switch the “Sort by column” dynamically. (eg based on a slicer)
So in the situation that you want to swap a financial report from a financial year point of view
to a calendar year point of view.

What I would like is that then, the month order is swapped from

JUL / AUG / SEPT / … / JUN
to

JAN / FEB / MARCH …/ DEC

Only things I found was something like this:

https://www.tringuyenminh92.com/index.php/2018/01/07/sort-by-column-feature-to-keep-data-in-custom-order/

But that feels a bit hacky / cumbersome? Just wondering if there were other workarounds for this type of scenario.


#2

Good use case.

Personally I’m not actually aware of way to complete this as you described.

The example link you placed in here I don’t think even solves it either.

This link here would go close to solving it. But it’s a big work around also - https://www.fourmoo.com/2017/01/24/power-bi-how-to-filter-slicers-dynamically/

I like to always default to the simpliest solution here, because it’s a lot of effort and room being taken up in your model with workarounds like this.

I would personally just add different slicers to the page for each option and visually make it clear that the user can slice the data by either option.

That’s my two cents. Chrs


#3

Thats a neat solution indeed. Also more for the simple solution but sometimes wondering what is possible!
Thanks.