Forum Discussion
Rank In PBI
Hi, Anonymous
Thanks for your quick response and the relationship image about your model.
For your need , you want to get the "For each news type I want to see Top 1 Content title which is having Highest views".
But for the [news type] in your 'Dim Table' is a measure (if a measure , how do you get this)? Secondly , the [news type] and the [Content_title] is one-to-many?
Can you give me some simple test data for these three tables and the end result you want to get in a table format. This will make the case very easy!
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
This is the sample data I created in excel for your reference
I have created many to one from Fact Content to Fact User on ID Column
and Many to many from Fact Content to Fact User on User ID
On News type
I have datas_ column based on that I created
- v-yueyunzh-msft3 years agoCommunity Support
Hi, Anonymous
Thanks for your quick response and your sample data first!
I create some test data like this and this is my understand:
And this is the relationship:
If this , the 'Dim Content' table can directly filter the 'Fact User' Table .
We can create a measure like this:
Measure 2 = MAXX( TOPN(1, ADDCOLUMNS( CALCULATETABLE( SUMMARIZE('Dim Content','Dim Content'[ID],'Dim Content'[Content tiltle]) , ALLEXCEPT('Dim Content','Dim Content'[News Type]) ) , "Views" , CALCULATE(SUM('Fact User'[Views]))) ,[Views] ,DESC) , [Content tiltle])Then we can get the result as follows:
If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem. (You can also upload you sample .pbix [without sensitive data] to the OneDrive and share with the OneDrive link to me ! )
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
- Anonymous3 years agoNot applicable
Hi,
Thanks a lot
In the same way I used MINX function to show minimum viewwd content title, but it has shown same views for both Highest and lowest viewed content titles
Please help on this
Thanks- v-yueyunzh-msft3 years agoCommunity Support
Hi , Anonymous
Thanks for your quick response!According to your description, you want to show the last1 content title , if this , you can replace the DESC to ASC to check if it can meet your need.
Measure 2 = MAXX( TOPN(1, ADDCOLUMNS( CALCULATETABLE( SUMMARIZE('Dim Content','Dim Content'[ID],'Dim Content'[Content tiltle]) , ALLEXCEPT('Dim Content','Dim Content'[News Type]) ) , "Views" , CALCULATE(SUM('Fact User'[Views]))) ,[Views] ,ASC) , [Content tiltle])The MAXX() in this dax code just get the text in the table got from TOPN() function.So when you replace the MAXX() to MINX() , it will show the same in your visual.
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