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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Yonah
Helper II
Helper II

Rankx with condition not working

Hi,
so I have a very strange Problem, I try to Rank Products but only if they have five Points.
But I get this result 

WROMG.PNG

So it looks like even if the Product 3 still get a Rank, even if at has only 4 Points.
So the Result I want should be something like

BezeichnungRank
11
22
3 
43


The DAX for checking for the Points is:

 

01_Punkte =
VAR SUM_DB3 =
    SUM ( '01 Lagerführend'[DB3] )
VAR SUM_DB3_pro_Stueck = [00_DB3_pro_Stück]
VAR SUM_Rendite = [Rendite Lagerführend 100]
VAR SUM_Retouren = [Umsatz Retouren Quote]
VAR SUM_Menge =
    SUM ( '01 Lagerführend'[Menge] )
VAR SUM_Parameter_DB3 =
    SUM ( '03 DB3'[Parameter] )
VAR SUM_Parameter_DB3_pro_Stueck =
    SUM ( '03 DB3 pro Stück'[DB3 pro Stück] )
VAR SUM_Parameter_Rendite =
    SUM ( '03 Rendite Lagerführend'[Rendite Lagerführend] )
VAR SUM_Parameter_Retouren =
    SUM ( '03 Retouren'[Retouren] )
VAR SUM_Parameter_Menge =
    SUM ( '03 Menge Lagerführend'[Menge Lagerführend] )
VAR CHECK_DB3 =
    IF ( SUM_DB3 >= SUM_Parameter_DB3, 1, 0 )
VAR CHECK_DB3_pro_Stueck =
    IF ( SUM_DB3_pro_Stueck >= SUM_Parameter_DB3_pro_Stueck, 1, 0 )
VAR CHECK_Rendite =
    IF ( SUM_Rendite >= SUM_Parameter_Rendite, 1, 0 )
VAR Check_Retouren =
    IF ( SUM_Retouren <= SUM_Parameter_Retouren, 1, 0 )
VAR Check_Menge =
    IF ( SUM_Menge >= SUM_Parameter_Menge, 1, 0 )
VAR Sum_Check = CHECK_DB3 + CHECK_DB3_pro_Stueck + Check_Menge + CHECK_Rendite + Check_Retouren
VAR Punkte = Sum_Check
RETURN
    Punkte

 

The DAX for the Ranking is:

 

02_Ranking =
VAR __Table =
    ADDCOLUMNS ( ALLSELECTED ( '01 Lagerführend' ), "__Punkte", [01_Punkte] )
VAR Ranking =
    IF (
        AND ( HASONEVALUE ( '01 Lagerführend'[Bezeichnung] ), [01_Punkte] = 5 ),
        RANKX (
            ALLSELECTED ( '01 Lagerführend'[Bezeichnung] ),
            [DB3_Lagerführend],
            ,
            DESC
        ),
        ""
    )
RETURN
    Ranking

 

 

Here is a Link to a sample file.
https://clptradinggmbh699-my.sharepoint.com/:f:/g/personal/aust_clptradinggmbh699_onmicrosoft_com/Ep...


Thanks

3 REPLIES 3
mangaus1111
Solution Sage
Solution Sage

Hi @Yonah ,

try to select Don't Summarize here.

mangaus1111_0-1667836464305.png

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

 

It's stays the same. 

Hi @Yonah ,

see my pbi file. It seems it works

https://1drv.ms/u/s!Aj45jbu0mDVJi0KpWsicFQTid58u?e=AqA84f

 

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

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! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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