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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

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
Anonymous
Not applicable

Hi @Young_G_Han ,

 

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

 

Cheers

 

CheenuSing

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.

Anonymous
Not applicable

Hi @Young_G_Han ,

 

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

 

Cheers

 

CheenuSing

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.