Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
Hi pls need help on how can i have the result i required, on my table from week 1 to current on the result i want to registered 1 if the number is max and 0 if not on the particular week. sample below for week 29 and 30.
OUTPUT
| Week | Count/Trade | Result |
| 29 | 91 | 0 |
| 29 | 91 | 0 |
| 29 | 91 | 0 |
| 29 | 91 | 0 |
| 29 | 91 | 0 |
| 29 | 91 | 0 |
| 29 | 91 | 0 |
| 29 | 91 | 0 |
| 29 | 91 | 0 |
| 29 | 137 | 1 |
| 29 | 137 | 1 |
| 29 | 137 | 1 |
| 29 | 137 | 1 |
| 29 | 137 | 1 |
| 29 | 137 | 1 |
| 29 | 137 | 1 |
| 29 | 137 | 1 |
| 29 | 15 | 0 |
| 29 | 15 | 0 |
| 29 | 15 | 0 |
| 29 | 15 | 0 |
| 30 | 16 | 0 |
| 30 | 16 | 0 |
| 30 | 16 | 0 |
| 30 | 16 | 0 |
| 30 | 16 | 0 |
| 30 | 16 | 0 |
| 30 | 16 | 0 |
| 30 | 110 | 0 |
| 30 | 110 | 0 |
| 30 | 110 | 0 |
| 30 | 89 | 0 |
| 30 | 89 | 0 |
| 30 | 89 | 0 |
| 30 | 139 | 1 |
| 30 | 139 | 1 |
| 30 | 139 | 1 |
| 30 | 139 | 1 |
| 30 | 14 | 0 |
| 30 | 14 | 0 |
| 30 | 14 | 0 |
| 30 | 16 | 0 |
| 30 | 16 | 0 |
Solved! Go to Solution.
You will need to create a new calculated column in your data model to determine if a value is the maximum for its respective week.
Result =
IF(
'YourTable'[Count/Trade] =
CALCULATE(
MAX('YourTable'[Count/Trade]),
ALLEXCEPT('YourTable', 'YourTable'[Week])
),
1,
0
)
Proud to be a Super User! |
|
@AllanBerces
I would recommend to create custom column rather than calculated column. Below is the M code
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMrJU0lGyNFSK1aET29DYnD4cU6LZxgYgthkN2IYGxHAsLAmzDY3J4JgQwUZzeiwA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Week = _t, Trade = _t]),
TypeChanged = Table.TransformColumnTypes(Source,{{"Week", Int64.Type}, {"Trade", Int64.Type}}),
Result = let
GroupTable =
Table.Group(
TypeChanged, {"Week"},{{"AllRows",each _}}
)[AllRows],
MaxTradeAdded =
List.Transform(GroupTable,(x) =>
Table.AddColumn(x,"Result", each if [Trade] =List.Max(x[Trade]) then 1 else 0 )
),
Result = Table.Combine(MaxTradeAdded)
in
Result
in
Result
Hopt this will help
Regards,
sanalytics
Hi @AllanBerces ,
Please try this calculated column
You will need to create a new calculated column in your data model to determine if a value is the maximum for its respective week.
Result =
IF(
'YourTable'[Count/Trade] =
CALCULATE(
MAX('YourTable'[Count/Trade]),
ALLEXCEPT('YourTable', 'YourTable'[Week])
),
1,
0
)
Proud to be a Super User! |
|
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 64 | |
| 51 | |
| 46 | |
| 23 | |
| 19 |
| User | Count |
|---|---|
| 136 | |
| 110 | |
| 50 | |
| 32 | |
| 29 |