Forum Discussion
Rank In PBI
Hi , Anonymous
Thanks for your quick response! Soorry for that this dax code can not work in your side . Did you not put [News Type] as dimension in your visual so that the dax code will not work.
If you just put the [Content Title] in the visual , you can use this dax code:
Measure 2 =
var _cur_type= MAX('Table'[News Type])
var _t =CALCULATETABLE( SUMMARIZE(ALLSELECTED('Table'),'Table'[News Type],'Table'[Content Title],"views" ,CALCULATE( SUM('Table'[Views]))) )
var _t2 = FILTER(_t, [News Type] = _cur_type)
return
IF( MAXX(topn(1,_t2,[views],DESC) , [Content Title]) = MAX('Table'[Content Title]) , 1, -1)
Since placing different fields will result in different filtering contexts, if this DAX code still cannot meet your needs, you can provide me with the fields you need to place and your final results in a table form.
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi,
I am adding News type as dimension only.
I am adding content title, News type, Views, Published date, created by name
I am filtering it by date
For example If i select between 1st june 2023 to 30th june 2023 it must show only one top view content title for each news
and there is many published dates for one date
For example for 1st june 2023 there are many published dates
Here view is , content title viewd by user on that date
Published date is date when the content is published
all this columns i am adding
Please reply
Thanks