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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.