Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
viralpatel21
Helper II
Helper II

Convert Calculated Column to Measure

Hello

I was wondering if its possible to convert this Calcuated column to a measure.. i did try to use Max but the values were wrong.

 

Surplus Transaction (USD) =
VAR usd =
    IF (
        au_cryptopayments[au_providedreference] = "V2"
            || au_cryptopayments[au_providedreference] = "V2 - GSB-Direct",
        au_cryptopayments[FiatAmountUSD_v2],
        IF (
            au_cryptopayments[au_transactiontype] = "Deposit",
            au_cryptopayments[FiatAmountUSD_v2],
            IF (
                au_cryptopayments[au_address] = "OTC Transaction",
                au_cryptopayments[au_actualfxtargetamount],
                au_cryptopayments[FiatAmount_USD]
            )
        )
    )
RETURN
    IF (
        OR (
            au_cryptopayments[au_transactiontype] = "Sell",
            au_cryptopayments[au_transactiontype] = "Deposit"
        ),
        usd,
    IF (
        OR (
            au_cryptopayments[au_transactiontype] = "Resub",
            au_cryptopayments[au_transactiontype] = "Subscription"
        ),
        usd, BLANK()  
    ))
 
Thanks
Viral
2 REPLIES 2
Anonymous
Not applicable

Hi @viralpatel21 

 

Are the fields in a visual, maybe you can use selectedvalue() function:

SELECTEDVALUE function - DAX | Microsoft Learn

 

Best Regards,

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@viralpatel21 , You can move the code inside maxx, but I doubt that can help  you

 

maxx(au_cryptopayments, <Your code>)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.