Forum Discussion
Distinct Count rows based on Dimension Attribute Order Priority
tvw83 , Few ways. Create a rank column and filter on 1.
rank column = rankx(filter(Table, [document_id] = earlier([document_id])), [Status_id],,desc,dense)
or try a measure like this.
measure = calculate(count(Table[document_id]), filter(Table , Table[status]= calculate(max([Status_id]),allexcept(Table,table[document_id]))))
- Anonymous5 years agoNot applicable
Hi amitchandak,
Unfortunately that is not completely what I'm looking for. I would like to sort/rank based on a field in the dimension table (dimPriority) that is not in the fact table. In my sample, I have put them in one table, but only StatusId is the key between both fact table and dimension.
By coincidence, the result is the same if you sort on StatusID but that is not what I need.
Question is thus, how do I sort/rank in the Fact Table (DocumentId, Date, StatusID) based on a field in the Dimension Table (dimPriority) ?
Thank you in advance
- mahoneypat5 years agoMicrosoft Employee
To help suggest a specific expression, please provide an example of a visual (e.g., table or matrix) you would make that shows the correct result in context.
Regards,
Pat
- Anonymous5 years agoNot applicable
Hi, I slightly changed the data to show a real case.
Below printscreen of the relationship. I would like to count based on the field Priority in the dimension table.Relationship
And hereafter a printscreen of the Fact, Dimension tables as matrix.
Please look at DocumentId 5, it should be counted once for StatusID=3 and not StatusID 4. Why ? Based on the priority (the lower the more important), StatusID 3 is prior. So I would like to count it for that status.
But for this, I need to be able to sort based on the Priority column.
Matrix of Fact, Dimension and result
Any suggestion ?
Kr