Forum Discussion
get a sort value for unlinked records
Hi
I'm new to Power Bi so sorry inadvance for the possible stupid questions.
I have a database loaded into te model with incidents and a priority level.
in different tables linked on the priorityid.
When i count the incidents i get somethin like this (fictional numbers)
P1 70
P2 400
P3 1000
P4 3000
400
So the last 400 incidents didn't get a Piriority id does count them as expected.
now i added a value to the priority to sort them (1 - 4) so i can put them in order (the text values contain more data then the P-number)
but the 400 without priority dont get an number.
So i want to mak a column where i put the ordernumber when it exists and the biggest ordernumber +1 when it doesn't exist.
but i can't get it right.
I tried:
how can i solve this?
- Anonymous7 years ago
Hi,
Thanks for the answers, they didn't really did the trick but they set me on the path to the solution.
This works:PrioritySort = IF ( ISBLANK ( Incidents[priorityId] ) , MAX ( IncidentPriorities[IncidentPriorityOrder] ) + 1 , RELATED(IncidentPriorities[IncidentPriorityOrder] ) )
4 Replies
- Greg_Deckler
Community Champion
Sample data would help. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
That being said, it looks like you have a measure and so in measures you need to have an aggregator around a column like SUM, MAX, COUNT, etc.
- AnonymousNot applicable
Hi ,
Here some sample date:
The first row i want to put 5 in a new column and the other rows shou state the incidentPriorityOrder
so i can sort 1- 5regards
Christoph
- v-yuta-msft
Community Support
Anonymous ,
You may change measure to calculate column:
SpoilerPrioritySort =
IF (
ISBLANK ( Incidents[priorityId] ),
MAX ( IncidentPriorities[IncidentPriorityOrder] ) + 1,
IncidentPriorities[IncidentPriorityOrder]
)Community Support Team _ Jimmy Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- AnonymousNot applicable
Hi,
Thanks for the answers, they didn't really did the trick but they set me on the path to the solution.
This works:PrioritySort = IF ( ISBLANK ( Incidents[priorityId] ) , MAX ( IncidentPriorities[IncidentPriorityOrder] ) + 1 , RELATED(IncidentPriorities[IncidentPriorityOrder] ) )