Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
DJsummers
Helper I
Helper I

Automatically Highlight Top Values Dependent on Owner

Hi - I have looked at many articles and videos and I have nearly solved my problem but not quite. We have a report at the end of each crop (farming business), which shows all issues raised during the cycle:

DJsummers_0-1651501441459.png

 

We would also like to highlight the top 3 most common issues seperately so that the other visuals are highlighted also:

DJsummers_1-1651501856821.png

Then the same for 2nd (Lo Temps) and 3rd (CO2) I created a crude table, for now, to select the top 3 and save each as a bookmark:

DJsummers_2-1651501986935.png

My top 3 value is a measure ([Sales] is just a count of all the issues) and I have used a filter 'Top 3 is less than 4' to get my top 3

Top 3 = RANKX(ALL('EndOfCropViewForLatestCrop2'[IssueTypeTranslated]), [Sales],,,Dense

 

That all works fine and dandy for the current farm but when I change to a different farm that has a different top 3, Water Consumption is still there but now it has switched to Number 2:

DJsummers_3-1651502267331.png

Not a massive problem here but there are instances where we don't have sight of water or feed for certain parameters so wouldn't work.

Is there a way for it to highlight Top 1, Top 2 & Top 3 rather than it using the IssueTypeTranslated as the main sort?

We would like to automate the reports so that we're not having to manually change what the top 3 issues were at the end of each crop cycle.

 

Any help would be gratefully received. Please let me know if you require more information.
 
@amitchandak, you were a massive help in the past but I'm not demanding you answer!

Dan

 

1 ACCEPTED SOLUTION
v-rzhou-msft
Community Support
Community Support

Hi @DJsummers ,

 

According to your statement, I think you need to create a rank measure as a filter to get dynamic rank based on farm selection.

As far as I know, we couldn't add a measure as a filter in level higher than visual level filter. 

I create a easy sample to have a test.

RicoZhou_0-1651827963135.png

In your sample, [Sales] measure should be a count. In mine, it is a sum.

Try this code to create a measure.

Rank = 
VAR _SUMMAZIRE =
    SUMMARIZE (
        ALLEXCEPT ( EndOfCropViewForLatestCrop2, EndOfCropViewForLatestCrop2[Farm] ),
        EndOfCropViewForLatestCrop2[IssueTypeTranslated],
        "Sales", [Sales]
    )
VAR _ADDRANK =
    ADDCOLUMNS ( _SUMMAZIRE, "RANK", RANKX ( _SUMMAZIRE, [Sales],, DESC, DENSE ) )
RETURN
    SUMX (
        FILTER (
            _ADDRANK,
            [IssueTypeTranslated] = MAX ( EndOfCropViewForLatestCrop2[IssueTypeTranslated] )
        ),
        [RANK]
    )

Then add this measure into visual level filters in all your visuals and set it to show items less than or equal to 3.

Select Farm A:

RicoZhou_1-1651828083635.png

Select Farm B:

RicoZhou_2-1651828093182.png

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

View solution in original post

2 REPLIES 2
v-rzhou-msft
Community Support
Community Support

Hi @DJsummers ,

 

According to your statement, I think you need to create a rank measure as a filter to get dynamic rank based on farm selection.

As far as I know, we couldn't add a measure as a filter in level higher than visual level filter. 

I create a easy sample to have a test.

RicoZhou_0-1651827963135.png

In your sample, [Sales] measure should be a count. In mine, it is a sum.

Try this code to create a measure.

Rank = 
VAR _SUMMAZIRE =
    SUMMARIZE (
        ALLEXCEPT ( EndOfCropViewForLatestCrop2, EndOfCropViewForLatestCrop2[Farm] ),
        EndOfCropViewForLatestCrop2[IssueTypeTranslated],
        "Sales", [Sales]
    )
VAR _ADDRANK =
    ADDCOLUMNS ( _SUMMAZIRE, "RANK", RANKX ( _SUMMAZIRE, [Sales],, DESC, DENSE ) )
RETURN
    SUMX (
        FILTER (
            _ADDRANK,
            [IssueTypeTranslated] = MAX ( EndOfCropViewForLatestCrop2[IssueTypeTranslated] )
        ),
        [RANK]
    )

Then add this measure into visual level filters in all your visuals and set it to show items less than or equal to 3.

Select Farm A:

RicoZhou_1-1651828083635.png

Select Farm B:

RicoZhou_2-1651828093182.png

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

speedramps
Super User
Super User

Hi DJSummer

 

I am not sure I have understood.

Sorry, your description goes on a bit 😀

I apprecaite you are keen to show what you can do (which is really good)
but please provide example tables of the source data
and the desired output with a bried description.

Best to copy and paste tables rather than images, then we can quickly import the data and create a solution 

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.