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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare 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
v-xinruzhu-msft
Community Support
Community Support

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>)

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.

October NL Carousel

Fabric Community Update - October 2024

Find out what's new and trending in the Fabric Community.