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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
rob7one
Helper I
Helper I

Rankx with two subcategories

Hello guys,

 

can someone tell what is wrong here?

 

Rankx with 2 categories = CALCULATE(RANKX(ALL(a_notifi_list,a_notifi_list[Name 1 /vendor name]),a_notifi_list[Defective (external)],,DESC),a_notifi_list[format date_yyyy.mm],a_notifi_list[Plant for material /plant number])
 
It displays the following error:
 
Multiple table arguments are not allowed in the ALL/ALLNOBLANKROW/REMOVEFILTERS function.
1 ACCEPTED SOLUTION

@rob7one A measure to capture supplier Rank by mm.yyyy and factory

Measure = 
RANKX (
    FILTER (
        ALL ( 'Table 1' ),
        'Table 1'[mm.yyyy] = MAX ( 'Table 1'[mm.yyyy] )
            && 'Table 1'[factory] = MAX ( 'Table 1'[factory] )
    ),
    CALCULATE ( MAX ( 'Table 1'[amount of defects] ) ),
    ,
    DESC,
    DENSE
)

 

PFA Workbook

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

View solution in original post

8 REPLIES 8
rob7one
Helper I
Helper I

Now, i would like to rank all the suppliers by amount of defects for every month and plant (in a common measure or column).

something like this:

rob7one_0-1676474646579.png

The final result is to know often each supplier was in top five ranking (in the picture is top3) in the last 12 months and how often is every factory affected by this.

 

final report visual is this:

 

rob7one_1-1676474946878.png

y-axis : vendors listed

x-axis amount of being present in top five ranking last 12 months (in every month)

legend: factory A, factory B, and so on

 

I hope it's clear a bit more now.

rob7one
Helper I
Helper I

I try to describe my case a bit:

 

I would like to rank an amount of defects within 3 columns: month, plant and vendor column.

That means to show the rank by defects for all vendors for each plant and each month. Can't find a working solution for this for a long time. Is it possible to do it in a custom column? Because i need to count all the vendors with rank 1-5.

My idea is to create an additional column and set for every rank 1-5 the value "1" and for all the other ranks the value "0" and then just sum all the "1" values for every vendor. Just to know how often a vendor was in the top 5 ranking in every plant for every month.

Hi, @rob7one 

 

Can you provide sample data for testing? Sensitive information can be removed in advance. What kind of expected results do you expect? You can also show it with pictures or Excel. I look forward to your response.

 

Best Regards,

Community Support Team _Charlotte

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

Hello Charlotte 🙂

 

here is a table with sample data:

 

mm.yyyyfactorysupplieramount of defects
01.2022Bxx12
01.2022Ccc23
03.2022Dyx34
01.2022Ayc45
03.2022Bxy56
01.2022Dcx1
03.2022Axx0
01.2022Bcc8
01.2022Dcx300
01.2022Axy23
01.2022Bcy65
02.2022Cer87
02.2022Dtr11
01.2022Cxc65
01.2022Dcx300
01.2022Axy23
01.2022Bcy65
02.2022C tz87
02.2022D kl67
02.2022Eqw101
03.2022C tz87
02.2022D kl67
02.2022Eqw101
02.2022Eqw101
02.2022C tz87
02.2022D kl67
02.2022Eqw101
02.2022C tz87
02.2022D kl67
02.2022Eqw101
02.2022C tz87
02.2022D kl67
03.2022Eqw101
03.2022C tz87
03.2022D kl67
02.2022Eqw101
03.2022C tz87
02.2022D kl67
02.2022Eqw101
02.2022C tz87
03.2022D kl67
02.2022Eqw101
01.2022Ayy1
01.2022Bxx12
01.2022Ccc23
03.2022Dyx34
01.2022Ayc45
03.2022Bxy56
01.2022Ccy56
01.2022Dxc45
01.2022Acx34
01.2022Byx23
01.2022Ccx12
01.2022Dcx1
03.2022Axx0
01.2022Bcc8
01.2022Cxc65
01.2022Dcx300
01.2022Axy23
04.2022Bcy65
02.2022Cer87
02.2022Dtr11
04.2022Cxc65
01.2022Dcx300
01.2022Axy23
01.2022Bcy65
02.2022C tz87
02.2022D kl67
02.2022Eqw101
03.2022C tz87
02.2022D kl67
02.2022Eqw101
02.2022C tz87
02.2022D kl67
02.2022Eqw101
02.2022C tz87
04.2022D kl67
02.2022Eqw101
02.2022D kl67
02.2022Eqw101
02.2022C tz87
02.2022D kl67
02.2022Eqw101
02.2022C tz87
02.2022D kl67
04.2022Eqw101
02.2022C tz87
02.2022C tz87
02.2022D kl67
02.2022Eqw101
03.2022Eqw101
03.2022C tz87
03.2022D kl67
03.2022C tz87
04.2022C tz87
04.2022D kl67
04.2022Eqw101

@rob7one A measure to capture supplier Rank by mm.yyyy and factory

Measure = 
RANKX (
    FILTER (
        ALL ( 'Table 1' ),
        'Table 1'[mm.yyyy] = MAX ( 'Table 1'[mm.yyyy] )
            && 'Table 1'[factory] = MAX ( 'Table 1'[factory] )
    ),
    CALCULATE ( MAX ( 'Table 1'[amount of defects] ) ),
    ,
    DESC,
    DENSE
)

 

PFA Workbook

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

That could really help! i will check it tomorrow to verify my results! Thanks a lot my friend!

 

i use this rankx measure for an other visual:

 

A_rank top 5 history 2 = RANKX(ALL(a_notifi_list[vendor name]), CALCULATE(SUM(a_notifi_list[Defectives)])))
 
it seems to work, but when i use it in a matrix like you can see below, it shows me for each vendor the value "1". i think that could be vendors which are not present with defects in the column of the month, but i'm not sure. Do you know how i can fix this? on the left side of the matrix are all vendors listed row by row.

 

rob7one_0-1676502538754.png

 

jaweher899
Super User
Super User

please try 

 

Rankx with 2 categories =
CALCULATE(
RANKX(
CALCULATETABLE(
ALL(a_notifi_list),
a_notifi_list[format date_yyyy.mm] = SELECTEDVALUE(a_notifi_list[format date_yyyy.mm]),
a_notifi_list[Plant for material /plant number] = SELECTEDVALUE(a_notifi_list[Plant for material /plant number])
),
a_notifi_list[Defective (external)],
,DESC
),
ALL(a_notifi_list)
)

Hi @jaweher899 

 

it shows me the following error:

 

A single value for column 'Defective (external)' in table 'a_notifi_list' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result.

 

How i can fix this?

 

Thank you in advance !

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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