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
TomaKavi
Helper I
Helper I

how tu sum more filtered fields in one column

Hello guys,

is there a better way how to make a simple sum for specific fields in one Column than this below ? 

SR1100 positive 3 =
CALCULATE (
    [Total Value],
    FILTER (
        Total_2021,
        Total_2021[Consolidation account] IN { "V10000""V20000""V30000" }
    )
)
1 ACCEPTED SOLUTION

Hi @TomaKavi 

Thanks for your reply.

>> I need this measure to be a part of another measure. ....  how to nest the 3 filtered values and sum them together.

The usual approach is to create a measure to calculate the total, and then create a measure to call it, for example

measure 1= sumx(filter('table', 'table '[xxx]=....),'table'[value])
measure 2= 
  var _totalFromM1=[measure 1]
  var _expression=calculate(....)
return _totalFromM1+_expression

This is the simplest way.

 

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
TomaKavi
Helper I
Helper I

actually not, I need this measure to be a part of another measure. I was more asking if there is another way ( a bit simple) how to nest the 3 filtered values and sum them together.

Hi @TomaKavi 

Thanks for your reply.

>> I need this measure to be a part of another measure. ....  how to nest the 3 filtered values and sum them together.

The usual approach is to create a measure to calculate the total, and then create a measure to call it, for example

measure 1= sumx(filter('table', 'table '[xxx]=....),'table'[value])
measure 2= 
  var _totalFromM1=[measure 1]
  var _expression=calculate(....)
return _totalFromM1+_expression

This is the simplest way.

 

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

and that is the poin HOW to add more values here  ,,Table [xxx] =......., how do you nest more parameters there ?

 

measure 1= sumx(filter('table', 'table '[xxx]=....),'table'[value])

 

Hi @TomaKavi 

Thanks for your reply.

>> how do you nest more parameters there

You can try 

 

measure 1= sumx(filter('table', 'table '[xxx1]=.... && 'table '[xxx2]=.... && 'table '[xxx3]=....),'table'[value])

 

 

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

got you, but what if we are talking about the same table, I guess the solution that I have written at the top is the only one right ?

v-xiaotang
Community Support
Community Support

Hi @TomaKavi 

You can choose according to your scenario. If you only need to call it once, use this method. 

vxiaotang_0-1655084662178.png

If you need to call it multiple times, create a table.

test = 
CALCULATE (
    SUM(Total_2021[value]),
    FILTER (
        Total_2021,
        Total_2021[Consolidation account] IN VALUES('filter'[Column1])
    )
)

vxiaotang_1-1655084835008.png

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

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.

Top Solution Authors