Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
hello, i have a table in which for each day i have the Sales % for each product, something like:
Date | Product | Sale for that day for that product | % Sale for that day for that product from total sales for that day|
I want to make a formula, in a column which return 3 values for each day, for each product, if the product sale Procent is in the top 70% the value should be tier1, is it is in the 70% from the last 30% from total it would say tier2 and blank for the rest
something like that.
Thank you
day | product | sales that day | total sales that day | %from total | Tier |
01.01.2023 | Product05 | 30 | 116 | 0.25862069 | Tier1 |
01.01.2023 | Product07 | 27 | 116 | 0.232758621 | Tier1 |
01.01.2023 | Product01 | 11 | 116 | 0.094827586 | Tier1 |
01.01.2023 | Product09 | 11 | 116 | 0.094827586 | Tier1 |
01.01.2023 | Product10 | 9 | 116 | 0.077586207 | Tier2 |
01.01.2023 | Product11 | 7 | 116 | 0.060344828 | Tier2 |
01.01.2023 | Product08 | 5 | 116 | 0.043103448 | Tier2 |
01.01.2023 | Product03 | 5 | 116 | 0.043103448 | |
01.01.2023 | Product06 | 5 | 116 | 0.043103448 | |
01.01.2023 | Product04 | 4 | 116 | 0.034482759 | |
01.01.2023 | Product02 | 2 | 116 | 0.017241379 | |
01.02.2023 | Product04 | 20 | 84 | 0.238095238 | Tier1 |
01.02.2023 | Product08 | 18 | 84 | 0.214285714 | Tier1 |
01.02.2023 | Product10 | 14 | 84 | 0.166666667 | Tier1 |
01.02.2023 | Product11 | 6 | 84 | 0.071428571 | Tier1 |
01.02.2023 | Product09 | 5 | 84 | 0.05952381 | Tier2 |
01.02.2023 | Product02 | 5 | 84 | 0.05952381 | Tier2 |
01.02.2023 | Product01 | 5 | 84 | 0.05952381 | Tier2 |
01.02.2023 | Product05 | 4 | 84 | 0.047619048 | |
01.02.2023 | Product03 | 3 | 84 | 0.035714286 | |
01.02.2023 | Product06 | 3 | 84 | 0.035714286 | |
01.02.2023 | Product07 | 1 | 84 | 0.011904762 | |
01.03.2023 | Product08 | 26 | 129 | 0.201550388 | Tier1 |
01.03.2023 | Product06 | 25 | 129 | 0.19379845 | Tier1 |
01.03.2023 | Product09 | 14 | 129 | 0.108527132 | Tier1 |
01.03.2023 | Product11 | 12 | 129 | 0.093023256 | Tier1 |
01.03.2023 | Product01 | 12 | 129 | 0.093023256 | Tier1 |
01.03.2023 | Product05 | 11 | 129 | 0.085271318 | Tier2 |
01.03.2023 | Product10 | 11 | 129 | 0.085271318 | Tier2 |
01.03.2023 | Product02 | 9 | 129 | 0.069767442 | |
01.03.2023 | Product04 | 5 | 129 | 0.03875969 | |
01.03.2023 | Product03 | 3 | 129 | 0.023255814 | |
01.03.2023 | Product07 | 1 | 129 | 0.007751938 |
Solved! Go to Solution.
Hi @cristianj ,
I created a sample pbix file(see the attachment), please find the details in it.
By measures:
rank =
VAR _seldate =
SELECTEDVALUE ( 'Table'[day] )
RETURN
RANKX (
FILTER ( ALLSELECTED ( 'Table' ), 'Table'[day] = _seldate ),
CALCULATE ( MAX ( 'Table'[%from total] ) ),
,
DESC,
DENSE
)
Tier =
VAR _seldate =
SELECTEDVALUE ( 'Table'[day] )
VAR _maxrank =
MAXX ( FILTER ( ALLSELECTED ( 'Table' ), 'Table'[day] = _seldate ), [rank] )
VAR _70perrank =
ROUND ( _maxrank * 0.7, 0 )
RETURN
IF (
[rank] <= _70perrank,
IF ( [rank] <= _70perrank * 0.7, "Tier1", "Tier2" ),
BLANK ()
)
By calculated columns:
Column =
RANKX (
FILTER ( 'Table', 'Table'[day] = EARLIER ( 'Table'[day] ) ),
'Table'[%from total],
,
DESC,
DENSE
)
Column 2 =
VAR _maxrank =
MAXX ( FILTER ( 'Table', 'Table'[day] = EARLIER ( 'Table'[day] ) ), [Column] )
VAR _70perrank =
ROUND ( _maxrank * 0.7, 0 )
RETURN
IF (
[Column] <= _70perrank,
IF ( [Column] <= _70perrank * 0.7, "Tier1", "Tier2" ),
BLANK ()
)
Best Regards
Hi @cristianj ,
I created a sample pbix file(see the attachment), please find the details in it.
By measures:
rank =
VAR _seldate =
SELECTEDVALUE ( 'Table'[day] )
RETURN
RANKX (
FILTER ( ALLSELECTED ( 'Table' ), 'Table'[day] = _seldate ),
CALCULATE ( MAX ( 'Table'[%from total] ) ),
,
DESC,
DENSE
)
Tier =
VAR _seldate =
SELECTEDVALUE ( 'Table'[day] )
VAR _maxrank =
MAXX ( FILTER ( ALLSELECTED ( 'Table' ), 'Table'[day] = _seldate ), [rank] )
VAR _70perrank =
ROUND ( _maxrank * 0.7, 0 )
RETURN
IF (
[rank] <= _70perrank,
IF ( [rank] <= _70perrank * 0.7, "Tier1", "Tier2" ),
BLANK ()
)
By calculated columns:
Column =
RANKX (
FILTER ( 'Table', 'Table'[day] = EARLIER ( 'Table'[day] ) ),
'Table'[%from total],
,
DESC,
DENSE
)
Column 2 =
VAR _maxrank =
MAXX ( FILTER ( 'Table', 'Table'[day] = EARLIER ( 'Table'[day] ) ), [Column] )
VAR _70perrank =
ROUND ( _maxrank * 0.7, 0 )
RETURN
IF (
[Column] <= _70perrank,
IF ( [Column] <= _70perrank * 0.7, "Tier1", "Tier2" ),
BLANK ()
)
Best Regards
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
61 | |
61 | |
55 | |
38 | |
27 |
User | Count |
---|---|
83 | |
61 | |
45 | |
41 | |
39 |