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
LeaRupnik
Helper III
Helper III

Top 10 on values

Hello,

I have to make a hierarchical table of the top 10 customers by the amount of im margin.

I know how to limit the quantity, the problem is that it does not limit it for all organizations, how could I limit the margin to the top 10 quantities.

I am adding an example in the attachment

 

The wish is to get like this

LeaRupnik_1-1652963240408.png

 

 

example:

https://drive.google.com/file/d/1E1pdjB1xKWsCqKTjEE2J3YUH_mAUyyJF/view?usp=sharing

 

thx

5 REPLIES 5
LeaRupnik
Helper III
Helper III

Thanks,
this works, but I'm having trouble sorting.
I have a measure now
Količina =
var _max = MAXX(ALLSELECTED('nov_27'), nov_27[datum_posnetka])
return
CALCULATE (
SUM (nov_27[izdkol] ),
FILTER ( ALL ( nov_27), nov_27[datum_posnetka] = _max),
VALUES(nov_27[kupec]), VALUES(nov_27[progenot]))


and the measure of sorting
Top 10 po kolicini = RANKX(ALL(nov_27[kupec]), [Količina],,DESC)


the table I show can be sorted both under LU_PCP and LU_FT, and within that then the quantities are fitted. I can't show the Top 10 columns

new version powerBI
https://drive.google.com/file/d/1IZGEzxdqw84VZ4dCymFQdE_oi0XX-otv/view?usp=sharing

 

thx

@LeaRupnik isn't this what you want?

SpartaBI_0-1653036570278.png

 

i don't want without a top 10 column
LeaRupnik_0-1653038679644.png

 

@LeaRupnik try this:
Only write this measure:

 

Količina = 
VAR _max = MAXX(ALLSELECTED('nov_27'), nov_27[datum_posnetka])
VAR _result = 
 CALCULATE (
    SUM (nov_27[izdkol] ),  
    nov_27[datum_posnetka] = _max
)
VAR _rank = 
    RANKX(
        ALLSELECTED(nov_27[kupec]), 
         CALCULATE (
            SUM (nov_27[izdkol] ),  
            nov_27[datum_posnetka] = _max
        )
            ,_result
            ,DESC
    )
RETURN
    IF( _rank <= 10, _result, BLANK() )

 

No need for the visual level filter:

SpartaBI_0-1653039878774.png


2022-05-19 17_30_22-Re_ Need help on DAX function with measure vs colu... - Microsoft Power BI Commu.png

Showcase Report – Contoso By SpartaBI


SpartaBI_3-1652115470761.png   SpartaBI_1-1652115142093.png   SpartaBI_2-1652115154505.png

Full-Logo11.png

BurgerToPro
Frequent Visitor

You should be able to use the filter tab and unselecte the 'empty' values for the measure 'Top 10 kupcev'

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors