Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin 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.
Hi Experts,
I need a help.
The below formula is in calculated column I want to use the same formula in measure. How to convert this as a measure?
Calculated column formula:
Solved! Go to Solution.
Hi @Anonymous ,
Try this:
Jan =
IF (
CALCULATE (
COUNT ( SAP_Data[Period] ),
FILTER ( SAP_Data, SAP_Data[Period] = 1 )
) = 0,
0,
IF (
MAX ( CON_9[Country] ) = "Germany",
CALCULATE (
SUM ( SAP_Data[O_AMT] ),
FILTER (
SAP_Data,
SAP_Data[Month] = "Jan"
&& SAP_Data[Country] = MAX ( CON_9[Country] )
&& SAP_Data[Item_Code] = MAX ( CON_9[Item_code] )
)
)
- CALCULATE (
SUM ( CON_8[Jan] ),
FILTER ( CON_8, CON_8[Country] = MAX ( CON_9[Country] ) )
)
+ CALCULATE (
SUM ( TAX[T_AMT] ),
FILTER (
TAX,
TAX[Month] = "Jan"
&& TAX[Country] = MAX ( CON_9[Country] )
&& TAX[Item_Code] = MAX ( CON_9[Item_code] )
)
),
IF (
MAX ( CON_9[Country] ) = "Italy",
CALCULATE (
SUM ( SAP_Data[O_AMT] ),
FILTER (
SAP_Data,
SAP_Data[Month] = "Jan"
&& SAP_Data[Country] = MAX ( CON_9[Country] )
&& SAP_Data[Item_Code] = MAX ( CON_9[Item_code] )
)
)
- CALCULATE (
SUM ( CON_8[Jan] ),
FILTER ( CON_8, CON_8[Country] = MAX ( CON_9[Country] ) )
)
+ CALCULATE (
SUM ( TAX[T_AMT] ),
FILTER (
TAX,
TAX[Month] = "Jan"
&& TAX[Country] = MAX ( CON_9[Country] )
&& TAX[Item_Code] = MAX ( CON_9[Item_code] )
)
),
0
)
)
)
If there are some errors, please give me some screenshots or data sample.
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous
Try this one:
if you attach sample data it will be very helpful for us. Though please try this.
Hi @Anonymous
it's not working, getting error on the filter condition.
Regards
Swamy
Hi @Anonymous ,
Try this:
Jan =
IF (
CALCULATE (
COUNT ( SAP_Data[Period] ),
FILTER ( SAP_Data, SAP_Data[Period] = 1 )
) = 0,
0,
IF (
MAX ( CON_9[Country] ) = "Germany",
CALCULATE (
SUM ( SAP_Data[O_AMT] ),
FILTER (
SAP_Data,
SAP_Data[Month] = "Jan"
&& SAP_Data[Country] = MAX ( CON_9[Country] )
&& SAP_Data[Item_Code] = MAX ( CON_9[Item_code] )
)
)
- CALCULATE (
SUM ( CON_8[Jan] ),
FILTER ( CON_8, CON_8[Country] = MAX ( CON_9[Country] ) )
)
+ CALCULATE (
SUM ( TAX[T_AMT] ),
FILTER (
TAX,
TAX[Month] = "Jan"
&& TAX[Country] = MAX ( CON_9[Country] )
&& TAX[Item_Code] = MAX ( CON_9[Item_code] )
)
),
IF (
MAX ( CON_9[Country] ) = "Italy",
CALCULATE (
SUM ( SAP_Data[O_AMT] ),
FILTER (
SAP_Data,
SAP_Data[Month] = "Jan"
&& SAP_Data[Country] = MAX ( CON_9[Country] )
&& SAP_Data[Item_Code] = MAX ( CON_9[Item_code] )
)
)
- CALCULATE (
SUM ( CON_8[Jan] ),
FILTER ( CON_8, CON_8[Country] = MAX ( CON_9[Country] ) )
)
+ CALCULATE (
SUM ( TAX[T_AMT] ),
FILTER (
TAX,
TAX[Month] = "Jan"
&& TAX[Country] = MAX ( CON_9[Country] )
&& TAX[Item_Code] = MAX ( CON_9[Item_code] )
)
),
0
)
)
)
If there are some errors, please give me some screenshots or data sample.
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I missed the filter condition. 😊
I think it will work also with MAX(), MIN(), Firstnonblank(), LastNonblank().
could you please give sample of your pbix file for hands on.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
User | Count |
---|---|
80 | |
40 | |
31 | |
27 | |
27 |