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
snifer
Post Patron
Post Patron

sum of separate code

amountaccount code  account code 
101  115
52result-> 210
307  730
51    
52    

 

Create 3 different measurements in order to create a sum for each distinct account code

measure for account code 1

for account cod2

account code 7

1 ACCEPTED SOLUTION
v-cherch-msft
Employee
Employee

Hi @snifer 

You may create the measures like below:

Measure 1 = CALCULATE(SUM('Table'[amount]),'Table'[account code]=1)
Measure 2 = CALCULATE(SUM('Table'[amount]),'Table'[account code]=2)
Measure 3 = CALCULATE(SUM('Table'[amount]),'Table'[account code]=7)

Regards,

Community Support Team _ Cherie Chen
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

5 REPLIES 5
v-cherch-msft
Employee
Employee

Hi @snifer 

You may create the measures like below:

Measure 1 = CALCULATE(SUM('Table'[amount]),'Table'[account code]=1)
Measure 2 = CALCULATE(SUM('Table'[amount]),'Table'[account code]=2)
Measure 3 = CALCULATE(SUM('Table'[amount]),'Table'[account code]=7)

Regards,

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Gopal30
Helper I
Helper I

Why don't you use Matrix visualization i think it will give you the same result.

kanthu
Frequent Visitor

dax.jpg

kanthu
Frequent Visitor

or use this:

 

Sum =
CALCULATE (
SUMX(table1, Table1[amount] ),ALLEXCEPT(Table1,Table1[account code])
)

@kanthu 

 

thanks, i can explain why, but i need 3 different measure each for every account code

 

basically ive create a measure [calculus] that calculate all total for all account code and now I need to filter this measure for each specific account code

 

I can filter through slicer or other but I need to create a measure that filter for each account so in this case 3 different measure

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.