Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hello Everyone
I am new at Power BI , and I have problem here in getting the correct Rankx
appreciate if anyone could help me out .
I have three tables
1, Statistics Table
| product | period | volume |
| Apple | Jan | 320 |
| Apple | Feb | 650 |
| Orange | Jan | 110 |
| Orange | Feb | 890 |
| Pear | Jan | 300 |
| Pear | Feb | 400 |
| Banana | Jan | 550 |
| Banana | Feb | 300 |
| 2000 | Jan | 400 |
| 2000 | Feb | 900 |
2, BridgeTable
| Product |
| apple |
| orange |
| pear |
| banana |
| 2000 |
3,BOM table
| component | product | qty |
| 1001 | apple | 1 |
| 1002 | apple | 2 |
| 1003 | apple | 3 |
| 1001 | orange | 1 |
| 1003 | orange | 6 |
| 1001 | pear | 1 |
| 1002 | pear | 8 |
| 1003 | banana | 2 |
| 1002 | banana | 4 |
| 2000 | 2000 | 1 |
the Measure I used RANKX(Statistics;[Component Volume];;ASC) , but the result is not correct as below picture , any clue ?? thanks
Solved! Go to Solution.
Try this one
rank = RANKX ( ALLSELECTED ( Bridgetable[product] ), [Component Volume],, ASC, DENSE )
If you donot want to rank the BLANKS..then
rank2 =
VAR myrank =
RANKX (
FILTER ( ALLSELECTED ( Bridgetable[product] ), [Component Volume] <> BLANK () ),
[Component Volume],
,
ASC,
DENSE
)
RETURN
IF ( NOT ( ISBLANK ( [Component Volume] ) ), myrank )
May be
= RANKX ( ALLSELECTED ( Statistics[product] ), [Component Volume],, ASC )
Could you share your file via onedrive or googledrive?
please check if you could reach it via the link
https://drive.google.com/file/d/1LSNQy8UgbOkHsIVjMCOJtMrkzZPkJWxu/view?usp=sharing
Please See file attached
Try this one
rank = RANKX ( ALLSELECTED ( Bridgetable[product] ), [Component Volume],, ASC, DENSE )
If you donot want to rank the BLANKS..then
rank2 =
VAR myrank =
RANKX (
FILTER ( ALLSELECTED ( Bridgetable[product] ), [Component Volume] <> BLANK () ),
[Component Volume],
,
ASC,
DENSE
)
RETURN
IF ( NOT ( ISBLANK ( [Component Volume] ) ), myrank )
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 44 | |
| 43 | |
| 38 | |
| 18 | |
| 16 |
| User | Count |
|---|---|
| 67 | |
| 63 | |
| 30 | |
| 30 | |
| 23 |