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

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
renatof
Most Valuable Professional
Most Valuable Professional

Measure based on array

Hi all,

 

how to create a measure which will give me the sum of amount column based on multiple types. 

TypeAmount
012200206148.6
03010062136
0311007895
032010105835.8
1020005000
102000-500
102900-5000
102900500
14000252.5
1400021973.75
14023012663.94
220000-262.5
220000-9868.75
221000-50655.7
240240-12663.9
401400210
430000-206149
431200-167972
6500000
66000050655.74
9999900

 

 

For example, I want to sum all values where type begins with 4* or where types in (400000 till 499999 maybe this will be better).

 

I tried with manually typing every type like Four = CALCULATE(sum(Table[Amount]);filter(Table;Table[Type] = "401400" || Table[Type] = "430000")) but this is not good when I have table with 100 different types of 4. 

 

Best regards,

Renato Fajdiga. 

3 REPLIES 3
Vvelarde
Community Champion
Community Champion

@renatof

 

If Type Column is Text you can use Value to transform in Number

 

SUMWITH4 =
CALCULATE (
    SUM ( Table1[Amount] ),
    FILTER (
        Table1,
        VALUE ( Table1[Type] ) >= 400000
            && VALUE ( Table1[Type] ) <= 499999
    )
)



Lima - Peru
PavelR
Solution Specialist
Solution Specialist

@renatof

You could try using filters on the right pane (Page level, Report level). You can define interval of Type, and when Type column is duplicated with data type text, then you also can filter as starts with 43, end with, contains etc.

And then simply have sum measure of amount column.

 

But unfortunately I think you can't use any easy filter directly on the page screen of PBI to this purpose, just only these filters on the right pane.

 

Regards.

Pavel

 

renatof
Most Valuable Professional
Most Valuable Professional

That's partly correct but I need all values for field type which starts with 2, 4 and 6. On Visual filters I have only options to put 2 filters one or (and) another.

 

 

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors