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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi can anyon help me to change the measure in to calculated column
Solved! Go to Solution.
Hi @AllanBerces ,
To change your TRADE_Count measure into a calculated column, you need a formula that works row by row instead of reacting to report filters. The key is to replace SELECTEDVALUE with a direct reference to the current row's data. This new column will, for each row, count how many total rows in the table share that specific row's date and code. This effectively calculates the daily trade count for that location and stores it on each row.
TRADE_Count_Column =
VAR _currentDate = 'Table01'[DATE]
VAR _currentCode = 'Table01'[Code]
RETURN
CALCULATE (
COUNTROWS ( 'Table01' ),
FILTER (
ALL ( 'Table01' ),
'Table01'[DATE] = _currentDate &&
'Table01'[Code] = _currentCode
)
)
Next, to convert the TRADE_Max Count/Week measure, you'll create a second calculated column that uses the first one you just made. For each row, this formula will find the highest daily count from your new TRADE_Count_Column that occurred within that row's specific week number and code. It scans the whole table, groups the data by week and code in the background, and then returns the peak daily value for that group.
TRADE_Max_Count_Week_Column =
VAR _currentWeek = 'Table01'[Week No:]
VAR _currentCode = 'Table01'[Code]
RETURN
CALCULATE (
MAX ( 'Table01'[TRADE_Count_Column] ),
FILTER (
ALL ( 'Table01' ),
'Table01'[Week No:] = _currentWeek &&
'Table01'[Code] = _currentCode
)
)
Best regards,
Hi @AllanBerces ,
To change your TRADE_Count measure into a calculated column, you need a formula that works row by row instead of reacting to report filters. The key is to replace SELECTEDVALUE with a direct reference to the current row's data. This new column will, for each row, count how many total rows in the table share that specific row's date and code. This effectively calculates the daily trade count for that location and stores it on each row.
TRADE_Count_Column =
VAR _currentDate = 'Table01'[DATE]
VAR _currentCode = 'Table01'[Code]
RETURN
CALCULATE (
COUNTROWS ( 'Table01' ),
FILTER (
ALL ( 'Table01' ),
'Table01'[DATE] = _currentDate &&
'Table01'[Code] = _currentCode
)
)
Next, to convert the TRADE_Max Count/Week measure, you'll create a second calculated column that uses the first one you just made. For each row, this formula will find the highest daily count from your new TRADE_Count_Column that occurred within that row's specific week number and code. It scans the whole table, groups the data by week and code in the background, and then returns the peak daily value for that group.
TRADE_Max_Count_Week_Column =
VAR _currentWeek = 'Table01'[Week No:]
VAR _currentCode = 'Table01'[Code]
RETURN
CALCULATE (
MAX ( 'Table01'[TRADE_Count_Column] ),
FILTER (
ALL ( 'Table01' ),
'Table01'[Week No:] = _currentWeek &&
'Table01'[Code] = _currentCode
)
)
Best regards,
Hi @AllanBerces this is from your earlier post- sharing the calculated columns , please try
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 37 | |
| 33 | |
| 33 | |
| 29 |
| User | Count |
|---|---|
| 132 | |
| 90 | |
| 78 | |
| 66 | |
| 65 |