The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
In my table I have columns DBA which is a list of customer names, and then NET_SALES.
I created the measure: Net_Sales(m) =
Solved! Go to Solution.
Hi,
I am not sure how your semantic model looks like, but I tried to create a sample pbix file like below.
Please check the below picture and the attached pbix file.
Net Sales measure =
VAR _netsales =
SUM ( Data[net_sales] )
RETURN
IF ( ISBLANK ( _netsales ), 0, _netsales )
RANK function (DAX) - DAX | Microsoft Learn
Rank net sales measure =
RANK (
SKIP,
ALL ( Data[customer_name] ),
ORDERBY ( [Net Sales measure], DESC )
)
I created a MaxRank measure
Do you have a solution on how to create the last measure where it looks at the Rank net sales measure and evenly divides the results into four quadrants based ona descening order? So if there's 100 rows, the first 1-25 rows that would have the highest net sales would be labeled as Quad 1, 26-50 as Quad 2, 51-75 as Quad 3, and 76-100 as Quad 4.
Hi,
Please check the below picture and the attached pbix file if it suits your requirement.
expected result measure: =
VAR _all =
COUNTROWS ( ALL ( Data[customer_name] ) )
VAR _rank = [Rank net sales measure]
RETURN
IF (
HASONEVALUE ( Data[customer_name] ),
SWITCH (
TRUE (),
DIVIDE ( _rank, _all ) <= 0.25, 1,
DIVIDE ( _rank, _all ) <= 0.5, 2,
DIVIDE ( _rank, _all ) <= 0.75, 3,
4
)
)
I've used a solution like this before and ran into the same issue I see here. Customer's F-S are grouped as 2, where F-K or F-I should be 2, and then K-S or I-S should be grouped as 3. So that we have four groupings evenly split or as close to evenly split.
Hi,
I am not sure how your semantic model looks like, but I tried to create a sample pbix file like below.
Please check the below picture and the attached pbix file.
Net Sales measure =
VAR _netsales =
SUM ( Data[net_sales] )
RETURN
IF ( ISBLANK ( _netsales ), 0, _netsales )
RANK function (DAX) - DAX | Microsoft Learn
Rank net sales measure =
RANK (
SKIP,
ALL ( Data[customer_name] ),
ORDERBY ( [Net Sales measure], DESC )
)
User | Count |
---|---|
15 | |
13 | |
8 | |
6 | |
6 |
User | Count |
---|---|
27 | |
19 | |
13 | |
9 | |
5 |