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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Yonah
Helper II
Helper II

Getting the total of Value used in Rankx

Hi,
i hope someone can help me.
I'm confused.
This is my dashboard.

Daschbord.PNG

 

What I want to achieve, is to get the Total of the Sum under the Column 04 Sum_N1_Top_5.
So that I can display it in the Card-View.
The whole thing is complicated by the fact that
I only would like to rank the values that lie above the values of the two parameter slicers.

To get a better understand, my DAX so far is
In the first Step, the Calculation of the Sum from Column N1.

 

01 Total_Sum_N1 =
SUM ( 'Export'[N1] )

 

The second Step is to check if the Values in the Column N1 and N2 are above the parameter slicers.

 

02 Points =
VAR SUM_N1 =
    SUM ( 'Export'[N1] )
VAR SUM_N2 =
    SUM ( 'Export'[N2] )
VAR SUMParameter_N1 =
    SUM ( N1[N1] )
VAR SUMParameter_N2 =
    SUM ( N2[Parameter] )
VAR Check_N1 =
    IF ( SUMParameter_N1 < SUM_N1, 1, 0 )
VAR Check_N2 =
    IF ( SUMParameter_N2 < SUM_N2, 1, 0 )
VAR Sum_Check = Check_N1 + Check_N2
RETURN
    Sum_Check

 

In the next Step is Ranking, with this DAX.

 

03 Ranking =
VAR __Table =
    ADDCOLUMNS ( 'Export', "__Points", [02 Points] )
VAR Ranking =
    IF (
        AND ( HASONEVALUE ( 'Export'[Bezeichnung] ), [02 Points] = 2 ),
        RANKX ( ALLSELECTED ( 'Export'[Bezeichnung] ), [01 Total_Sum_N1],, DESC, DENSE ),
        ""
    )
RETURN
    Ranking

 

Then in the next and final Step I want to get the total Value of, for example everything with a ranking of 5 or better.

 

04 Sum_N1_TOP_5 =
VAR __Table =
    ADDCOLUMNS ( 'Export', "__Ranking", [03 Ranking] )
VAR Ranking_Check =
    IF ( [03 Ranking] <= 5, 1, "" )
VAR Ranking_Sum =
    IF ( [03 Ranking] <= 5, SUM ( 'Export'[N1] ), "" )
RETURN
    Ranking_Sum

 

But now I get the Value of everything with a Ranking of 5 or better, but not the total that I need.

Mising Total.PNG


You can finde the data plus pbix file here 
https://1drv.ms/u/s!AoFqgLqZH-C0hMxf0ytDa_dP_BvGUw?e=uyv3Pb


Thanks

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Yonah ,

I updated your sample pbix file(see attachment),  please check if that is what you want. You can create another new measure as below to replace the original measure [04 Sum_N1_TOP_5] and put it on the visual....

Measure = 
IF (
    ISINSCOPE ( 'Export'[Bezeichnung] )
        && [03 Ranking] > 5,
    BLANK (),
    SUMX ( VALUES ( 'Export'[Bezeichnung] ), [04 Sum_N1_TOP_5] )
)

yingyinr_0-1666949529919.png

Best Regards

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Yonah ,

I updated your sample pbix file(see attachment),  please check if that is what you want. You can create another new measure as below to replace the original measure [04 Sum_N1_TOP_5] and put it on the visual....

Measure = 
IF (
    ISINSCOPE ( 'Export'[Bezeichnung] )
        && [03 Ranking] > 5,
    BLANK (),
    SUMX ( VALUES ( 'Export'[Bezeichnung] ), [04 Sum_N1_TOP_5] )
)

yingyinr_0-1666949529919.png

Best Regards

mangaus1111
Solution Sage
Solution Sage

Hi @Yonah ,

try this measure

Measure = 
IF(HASONEVALUE('Export'[Bezeichnung]),[04 Sum_N1_TOP_5],SUMX(VALUES('Export'[Bezeichnung]),[04 Sum_N1_TOP_5]))

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

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors
Top Kudoed Authors