- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Sorting by Measure that Uses Dynamic Format
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
12-07-2018 01:59 PM
I have a measure that dynamically changes based on a parameter that the user controls. The user can choose quantity or value from the parameter, and this measure switches to provide the selected value and formats it correctly. This is how the measure looks:
[Actual ] =
IF (
ISFILTERED ( 'Choose Comparison Metric'[Metric] ),
SWITCH (
TRUE (),
LASTNONBLANK ( 'Choose Comparison Metric'[Metric], "" ) = "Quantity", format(sum('Details'[Quantity]), "#,##0"),
LASTNONBLANK ( 'Choose Comparison Metric'[Metric], "" ) = "Value", format([This Month Value]/1000000, "$#,##0.0M"),
format(sum('Details'[Quantity]), "#,##0")
),
format(sum('Details'[Quantity]), "#,##0")
)
This part works fine, but the issue I am running into is that once this gets displayed in a matrix, Power BI is treating both of these as text and the user won't be able to sort by that column correctly if they click on the column header. I was wondering if there is a way to keep the formatting for display but force the sorting to be based on the actual value in the measure? if not, are there other solutions for this?
Re: Sorting by Measure that Uses Dynamic Format
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
12-07-2018 02:39 PM
No, you can’t do it. This is why the solution is only half a solution. You can vote for my idea here https://ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/15231165-conditional-formatted-me...
Re: Sorting by Measure that Uses Dynamic Format
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
12-07-2018 03:43 PM - edited 12-07-2018 03:43 PM
Thanks for the info Matt! I voted on your idea.