Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon'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.
Hi,
Is there a way when user selects one product in upper chart for line chart below to plot him what was product rank for each day?
For example, if total of 10 products were sold that day, product was on 2nd place ---> 2/10
Dataset is quite simple. Date | Product | Sales
Thank you!
Solved! Go to Solution.
Hi, @MrMP
First, thanks for @amitchandak help. If you have not solve the problem, you can try the following method.
DAX:
Rank =
RANKX (
FILTER (
'Table',
'Table'[Date] = EARLIER ( 'Table'[Date] )
),
'Table'[Sales],
,
DESC,
Dense
)
MaxRank =
VAR _maxRank = CALCULATE(MAX('Table'[Rank]))
RETURN
_maxRank
RANK BY Product =
IF (
CALCULATE ( SUM ( 'Table'[Rank] ) ) > [MaxRank],
"Please select one Product",
[MaxRank]
)
Best Regards,
Yang
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
Hi,
Not sure of what result you want. Share data in a format that can be pasted in an MS Excel file. Show the expected result clearly.
Hi, @MrMP
First, thanks for @amitchandak help. If you have not solve the problem, you can try the following method.
DAX:
Rank =
RANKX (
FILTER (
'Table',
'Table'[Date] = EARLIER ( 'Table'[Date] )
),
'Table'[Sales],
,
DESC,
Dense
)
MaxRank =
VAR _maxRank = CALCULATE(MAX('Table'[Rank]))
RETURN
_maxRank
RANK BY Product =
IF (
CALCULATE ( SUM ( 'Table'[Rank] ) ) > [MaxRank],
"Please select one Product",
[MaxRank]
)
Best Regards,
Yang
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
@MrMP , if you create a rank measure it will get distributed based on date in second visual and will give date of filtered product
rankx(allselected(Table[Product]), [Sales measure])
or new rank function
rank(DENSE,ALLSELECTED(Table[Product], Table[Date]),ORDERBY([Sales],DESC),, partitionBy(Table[Date]) )
Power BI - New DAX Function: RANK - How It Differs from RANKX: https://youtu.be/TjGkF44VtDo
Thank you for help. Bottom chart should be trend over time. With that measure, it gives rank 1 for every calendar date when I select product.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
124 | |
79 | |
49 | |
38 | |
37 |
User | Count |
---|---|
196 | |
80 | |
70 | |
51 | |
42 |