Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
I need to show No 1 Brand which has most sales value. For this I am making a measure where brands are ranked and then I am selecting one brand using TOP N (1) . The measure is giving accurate result most of the time but sometimes it it giving 2 numbers. But its not consistent. How to get rid of the issue. My measures are as follows,
Top Most Customer =
VAR pers =
SELECTEDVALUE ( 'Perspective Dim'[Perspective] )
RETURN
CONCATENATEX (
CALCULATETABLE (
TOPN (
1,
FILTER (
ALL ( 'Customer Dim'[CONSOLIDATED_GROUP_NAME] ),
NOT ( ISBLANK ( 'Customer Dim'[CONSOLIDATED_GROUP_NAME] ) )
&& NOT ( ISBLANK ( [vs LY] ) )
),
[CustomerRankDesc], ASC
)
),
'Customer Dim'[CONSOLIDATED_GROUP_NAME] & "(" & [vs LY Formatted] & ")",
", "
)
=====================================================================
CustomerRankDesc =
VAR CustomerName =
SELECTEDVALUE ( 'Customer Dim'[CONSOLIDATED_GROUP_NAME] )
RETURN
IF (
NOT ( ISBLANK ( [Total Value] ) ) && NOT ( ISBLANK ( CustomerName ) ),
RANKX ( ALL ( 'Customer Dim'[CONSOLIDATED_GROUP_NAME] ), [vs LY],, DESC, DENSE )
)
=====================================================================
vs LY =
DIVIDE ( ( [Selected Perspective] - [LY] ), [LY], 0 )
please try
Top Most Customer =
VAR pers =
SELECTEDVALUE ( 'Perspective Dim'[Perspective] )
RETURN
CONCATENATEX (
CALCULATETABLE (
TOPN (
1,
FILTER (
ALL ( 'Customer Dim'[CONSOLIDATED_GROUP_NAME] ),
NOT ( ISBLANK ( 'Customer Dim'[CONSOLIDATED_GROUP_NAME] ) )
),
[vs LY]
)
),
'Customer Dim'[CONSOLIDATED_GROUP_NAME] & "(" & [vs LY Formatted] & ")",
", "
)
User | Count |
---|---|
21 | |
19 | |
12 | |
9 | |
7 |
User | Count |
---|---|
30 | |
27 | |
14 | |
13 | |
11 |