Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Hi All,
working currently on a project where I need to filter certain values from a database in order to categorize them.
I need to have a measure that says filter all part numbers starting with the letter A.
Thats my current function:
Filter function =
SUMX(
FILTER(
'AO Domestic',
'AO Domestic'[Part Number] = "STARTS WITH A"
)
,
'AO Domestic'[Total Actual Cost incl. Retro. Pay])
Would be great if someone could tell me how to correct the measure. Thanks a lot in advance.
Kind regards
Solved! Go to Solution.
Hey,
you can write your measure like so
Measure 3 =
CALCULATE(
SUM('FactWithDates'[Amount])
,FILTER(
'FactWithDates'
,LEFT('FactWithDates'[Item],1) ="A"
)
) Hopefully this gets you started
Regards
Tom
Hello @TomMartens
This solution is great.
Can this measure be used to filter and leave only the alphabetical rows.
Means filter out everything that start with A to Z
Regards
Heinrich
Hey @Heinrich ,
you can adapt the measure like so:
Measure 3 =
CALCULATE(
SUM('FactWithDates'[Amount])
,FILTER(
'FactWithDates'
,LEFT('FactWithDates'[Item],1) in { "A", "B", "C" }
)
)
The curly braces define a table. Of course you can define a table in your semantic model that contains the rows A-Z, then the filter statement will look like this:
...
,LEFT('FactWithDates'[Item],1) in VALUES( 'tablename'[columnname] )
...
Hopefully this will help to tackle your challenge.
Regards,
Tom
Hey,
you can write your measure like so
Measure 3 =
CALCULATE(
SUM('FactWithDates'[Amount])
,FILTER(
'FactWithDates'
,LEFT('FactWithDates'[Item],1) ="A"
)
) Hopefully this gets you started
Regards
Tom
Hi thank you very much - that works.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 55 | |
| 34 | |
| 31 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 74 | |
| 71 | |
| 37 | |
| 35 | |
| 25 |