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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Raul
Post Patron
Post Patron

Convert a measure into M language

Hey guys,

I have create this measure:

 

Col. Renda = IF(LEFT(SELECTEDVALUE(RendaSocietats[Concepte Renda]);5)="FFG01";LOOKUPVALUE(ServeisClients[Colaborador];ServeisClients[CodServei];"REN";ServeisClients[CodClient];SELECTEDVALUE(RendaSocietats[CodClient]));BLANK())
 
But I can't use a slicer for a measure to filter a matrix visualization. I need to convert this measure into a calculated column but I don't know how translate it into M language:
 
Col. Renda = if Text.Start(RendaSocietats[Concepte Renda],5) = "FFG01" , LOOKUPVALUE(ServeisClients[Colaborador];ServeisClients[CodServei];"REN";ServeisClients[CodClient];SELECTEDVALUE(RendaSocietats[CodClient])) else ""
 
How is the correct statement?
Thank you very much and Merry Christmas!!
1 ACCEPTED SOLUTION
v-jiascu-msft
Employee
Employee

Hi @Raul

 

You don't have to use the M. You can use the calculated column instead. Please refer to the snapshot below. The formula could be like below, which is also the DAX.

Col. Renda =
IF (
    LEFT ( RendaSocietats[Concepte Renda]; 5 ) = "FFG01";
    LOOKUPVALUE (
        ServeisClients[Colaborador];
        ServeisClients[CodServei]; "REN";
        ServeisClients[CodClient]; RendaSocietats[CodClient]
    );
    BLANK ()
)

Convert-a-measure-into-M-language

 

Best Regards,
Dale

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

View solution in original post

2 REPLIES 2
v-jiascu-msft
Employee
Employee

Hi @Raul

 

You don't have to use the M. You can use the calculated column instead. Please refer to the snapshot below. The formula could be like below, which is also the DAX.

Col. Renda =
IF (
    LEFT ( RendaSocietats[Concepte Renda]; 5 ) = "FFG01";
    LOOKUPVALUE (
        ServeisClients[Colaborador];
        ServeisClients[CodServei]; "REN";
        ServeisClients[CodClient]; RendaSocietats[CodClient]
    );
    BLANK ()
)

Convert-a-measure-into-M-language

 

Best Regards,
Dale

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

Thank you vey much @v-jiascu-msft,

It's simple, that it's.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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