Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Solved! Go to Solution.
Hi @Sparkeltje
You can use LEN function to get the investments with 5 positions.
InvInvestments =
VAR FINYEAR =
SELECTEDVALUE ( 'table'[Financial_Year] )
RETURN
CALCULATE (
SUMX (
FILTER (
'table',
'table'[Source] = "PL"
&& LEN ( 'table'[PK_Inv#] ) = 5
&& 'table'[Type] IN { "1", "2" }
),
'table'[costs]
),
'table'[Financial_Year] = FINYEAR,
'table'[Financial_Year]
)
For more details about this function, you can refer LEN.
Best Regards
Caiyun Zheng
Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Yes. Thank you!
Hi @Sparkeltje
You can use LEN function to get the investments with 5 positions.
InvInvestments =
VAR FINYEAR =
SELECTEDVALUE ( 'table'[Financial_Year] )
RETURN
CALCULATE (
SUMX (
FILTER (
'table',
'table'[Source] = "PL"
&& LEN ( 'table'[PK_Inv#] ) = 5
&& 'table'[Type] IN { "1", "2" }
),
'table'[costs]
),
'table'[Financial_Year] = FINYEAR,
'table'[Financial_Year]
)
For more details about this function, you can refer LEN.
Best Regards
Caiyun Zheng
Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Problem is that calculation is needed only from the 2 investment numbers that have 5 positions. I don't get that working with contains or containsstring.
10624-VA06-360
10521-VA05-360
10500-VA04-60
11269
11281
10538-VA02-180
Hi, @Sparkeltje
Please try to use contains or containsstring DAX function.
Or, please have a look at the below article, if that is what you needed.
https://www.sqlbi.com/articles/from-sql-to-dax-string-comparison/
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
62 | |
58 | |
55 | |
36 | |
33 |
User | Count |
---|---|
81 | |
67 | |
45 | |
45 | |
43 |