Calculate with filter column starting with

Hi guys
My table has an account column, from 10 till 90. My measure is T Value.

I would like something like CALCULATE ( [T Value], FILTER [Account] = “4*” )
I want the sum of that measure but only the column account that starts with 4

Thank you all
Pedro

Hi @pedroccamara,

There is a function:

LEFT(<text>, <num_chars>)
which returns a set number of characters from text.
So something like,

CALCULATE ( [T Value], FILTER [Account] = LEFT(1,1) = “4” )

1 Like

@pedroccamara,

Yup, Following up on Marcster’s post, here’s one way to write the measure:

Sum of T Value for 4X Accounts = 
CALCULATE(
    SUMX(
        Data,
        [T Value]
    ),
    FILTER(
        Data,
        LEFT( Data[Account], 1 ) = "4"
    )
) 

image

Note: I wasn’t sure whether you meant T value in a formal statistical sense, or whether that was a stand-in for just some measure in your report. Thus in this example, my “T Value” measure is deviation from the mean, just for illustrative purposes.

I hope this is helpful. Full solution file attached.

1 Like

HI @pedroccamara, did the response provided by the contributors help you solve your query? If not, how far did you get and what kind of help you need further? If yes, kindly mark the thread as solved. Thanks!

Awesome!! Very good. Thank you so much Brian

It did. I’m so sorry for this late reply.
And thanks for reminding me.
Best regards

To the contributor of this post. Thank you for sharing your experiences around Power BI, please don’t hesitate to add more discussion or add value to wherever you think you possess the experience or knowledge that can help others in our Ecosystem Group. You can also help us in improving the Support forum further by answering the Enterprise DNA Forum User Experience Survey. We appreciate the initiative and your help in this group!