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
Fox5
Frequent Visitor

Filter measures results

Hi everyone

 

I use measures to calculate values A, B and C (the sum of value A + B) as shown in the table below. Now, I need to summarize the positive and negative Values C to create a key indicator (i.e. 1+[sum neg C / sum pos C]). How can this be achieved?

 

Value A (Result of Measure A)Value B (Result of Measure B)Value C (Result of Measure A+B)
500-600-100
1000-500500
2000-1500500

 

Sum of positive Value C = 1000

Sum of negative Value C = -100

 

1+(1000/-100) = 0.9

1 ACCEPTED SOLUTION

Hi @Fox5 ,

 

You need to use the columns added in the visual where the MeasureC is located for the SUMMARIZE function. 

 

Measure = 
var tab = SUMMARIZE('Table','Table'[Column1],'Table'[Column2],"C1",[MeasureC])
return SUMX( FILTER( tab, [C1] < 0 ), [C1])

vkkfmsft_0-1661407713142.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@Fox5 , You need use one or more group by for that

 

Divide(

Sumx(filter(Summarize(Table, Table[Column], "_1", [C]),[C] >0) ,[C]),

Sumx(filter(Summarize(Table, Table[Column], "_1", [C]),[C] <0) ,[C])

)

Thanks for your reply @amitchandak 

Using the DAX formula "Sumx(filter(Summarize(Table, Table[Column], "_1", [C]),[C] >0) ,[C])" results in the sum of C. Based on my exaple, the result is 900 instead of 1000.

 

Using the DAX formula "Sumx(filter(Summarize(Table, Table[Column], "_1", [C]),[C] <0) ,[C])" results in 0, instead of -100

Hi @Fox5 ,

 

You need to use the columns added in the visual where the MeasureC is located for the SUMMARIZE function. 

 

Measure = 
var tab = SUMMARIZE('Table','Table'[Column1],'Table'[Column2],"C1",[MeasureC])
return SUMX( FILTER( tab, [C1] < 0 ), [C1])

vkkfmsft_0-1661407713142.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

You're a genius 😄. Thank you very much.

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.