Search code examples
powerbipowerbi-desktoppowerbi-embeddedpowerbi-datasourcepowerbi-custom-visuals

How to copy highest value name as new column value in power bi?


I'm trying to create a new column which is filled by the highest value name and condition is today date and if suppose two values are the same then we have to pick the first one value name.

My table is

enter image description here

My Expected table is

enter image description here

Condition is

select screen name has new column value from the most viewed screen by using a count value, selected customer count should be 1 group by id and start date


Solution

  • Best approach here would be that you add a blank query in the query editor. Make the blank query the same table as your first table.

    =FirstTableName
    

    Call the blank query SecondTable for example.

    1. Add a filter with the current date.
    2. Group your table by Screen, by count and by the start date. (I think you need a count value that the grouping will work)
    3. Add a sort order for the column count (descanding).
    4. Delete all rows expect the first row.

    The result is now one row with the highest value in the count column on todays date. Join this one row now with your first table. The column screen and the start date are the join columns and expand the screen column from your joined table.

    This gives you the result like your second picture.