Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I have two rolling 12 measures for this year and one for last year and it is working per below but the major problem is that because the axis is just the month number without reference to the year, I cannot sort it by the month the user has selected. In the case below the user has select April 2020. So orange is April 2020 and dark blue is April 2019. For May the values are dark blue is May 2019 and light blue May 2018.
So I need April 2020 to be first (or last) depending on the sort order. I can only use the month number because adding the year to the axis means the columns seperate out chonologically.
I have run out of ideas! Anyone got a magic workaround?
many thanks!
David
Solved! Go to Solution.
Hi @DavidWaters100 ,
1. We need to create a new parameter to be a slicer.
2. Then we can create a measure to sort the Month.
Sort =
RANKX (
GENERATESERIES ( 1, 12 ),
IF ( [Value] <= [SelectMonth Value], [Value] + 12, [Value] ),
IF (
MIN ( 'Table'[Month] ) <= [SelectMonth Value],
MIN ( 'Table'[Month] ) + 12,
MIN ( 'Table'[Month] )
),
DESC,
DENSE
)
3. At last we can create a clustered column chart, and put the [sort] to Tooltips. And change the X axis type to Categorical. We can get the result like this,
If it doesn’t meet your requirement, could you please show the exact expected result based on the table that we have shared?
BTW, pbix as attached.
Best regards,
Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @DavidWaters100 ,
1. We need to create a new parameter to be a slicer.
2. Then we can create a measure to sort the Month.
Sort =
RANKX (
GENERATESERIES ( 1, 12 ),
IF ( [Value] <= [SelectMonth Value], [Value] + 12, [Value] ),
IF (
MIN ( 'Table'[Month] ) <= [SelectMonth Value],
MIN ( 'Table'[Month] ) + 12,
MIN ( 'Table'[Month] )
),
DESC,
DENSE
)
3. At last we can create a clustered column chart, and put the [sort] to Tooltips. And change the X axis type to Categorical. We can get the result like this,
If it doesn’t meet your requirement, could you please show the exact expected result based on the table that we have shared?
BTW, pbix as attached.
Best regards,
Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you, great post!
Sorry I have solved this now.
I added a column in my calendar table which returned the month number chosen by the user, then assigned an order decimal value on my calender table to the 12 month number of all years so that the chosen month had highest value, then the second highest was the previous month number etc.
I then used LOOKUPVALUES to look up the order value and return it to my table with the graph. I could then sort by the order value looked up.
Oh dear, I have not solved this! My calendar table was bringing in today's month, not the one selected by a user on another table!
I still haven't resolved this...
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
95 | |
77 | |
68 | |
54 |
User | Count |
---|---|
144 | |
105 | |
102 | |
89 | |
63 |