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

Add Ranking in a summarized table, but duplicated.

  Hi.

 

I made a summarized table with the following dax. However, there are some duplicated rankings even if the values are not similar.

Can you help me to solve the problem?

 

Ranking - Region =

VAR _month = MONTH(TODAY())
VAR _year = YEAR(TODAY())
VAR _RefYear = IF(_month > 6, _year, _year - 1)

RETURN
ADDCOLUMNS(
    SUMMARIZE(
        FILTER(
            '_SALES',
            (YEAR('_SALES'[Transaction Date]) = _RefYear &&
            RELATED(_CUSTOMER[Division Code]) IN {"1", "2", "3"} &&
            RELATED(_GROUP[Product Group Code]) = "A") &&
            '_SALES'[USD] > 0
        ),
        _CUSTOMER[Region Index],
        "Sales", SUM('_SALES'[USD]),
        "Year", _RefYear
    ),
    "Region Rank",
    RANKX(
        SUMMARIZE(
            FILTER(
                '_SALES',
                (YEAR('_SALES'[Transaction Date]) = _RefYear &&
                RELATED(_CUSTOMER[Division Code]) IN {"1", "2", "3"} &&
                RELATED(_GROUP[Product Group Code]) = "A") &&
                '_SALES DATA'[USD] > 0
            ),
            _CUSTOMER[Region Index],
            "Sales", SUM('_SALES DATA'[USD])
        ),
        [Sales],
        ,
        DESC,
        DENSE
    )
)
 
Region Index is a unique value in text.
Example result,
 
Region Index   Ranking  Sales
A                      20           4541889.2
B                      20           4681260.92
 
I don't think the A and B regions are the same ranking.
Please help me to solve this problem.
1 ACCEPTED SOLUTION
CheenuSing
Community Champion
Community Champion

Hi @Young_G_Han ,

 

Please share sample data in one drive and paste the link here to explore further.

 

Cheers

 

CheenuSing

Did I answer your question? Mark my post as a solution and also give KUDOS !

Proud to be a Datanaut!

View solution in original post

2 REPLIES 2
Young_G_Han
Helper III
Helper III

  Dear Sir.

 

The measure was correct for me. I just made a mistake.

 

Thank you.

CheenuSing
Community Champion
Community Champion

Hi @Young_G_Han ,

 

Please share sample data in one drive and paste the link here to explore further.

 

Cheers

 

CheenuSing

Did I answer your question? Mark my post as a solution and also give KUDOS !

Proud to be a Datanaut!

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.