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
abosan
New Member

Sample card filtered percentage of column total

Hello, total noob here.

I tried to search, but I'm so new that I'm not sure of the right terms to look for. As a result, none of the answers I found fit my stage.

Here's an example of the data I'm working with:

TransactionIDTransaction valueStatus of the transaction
123$1001
456$3001
789$502

What I would like to calculate is the value of transactions with a status of 1 as a percentage of the total sum of transaction values.

In this example, the correct answer must be 89%.

Can someone point me in the right direction?

1 ACCEPTED SOLUTION
v-gizhi-msft
Community Support
Community Support

Hi,

 

try this:

Measure = CALCULATE(SUM('Table'[Transaction Value]),FILTER('Table','Table'[Transaction Status]=1))/SUM('Table'[Transaction Value])

The result shows:

50.PNG

 

Best Regards,

Giotto Zhi

 

View solution in original post

3 REPLIES 3
v-gizhi-msft
Community Support
Community Support

Hi,

 

try this:

Measure = CALCULATE(SUM('Table'[Transaction Value]),FILTER('Table','Table'[Transaction Status]=1))/SUM('Table'[Transaction Value])

The result shows:

50.PNG

 

Best Regards,

Giotto Zhi

 

amitchandak
Super User
Super User

@abosan ,

Try

Measure = 
divide(
calculate(sumx(Filter(Table,Table[Transaction Status] =1 ),Table[Transaction Value])),
calculate(sum(Table[Transaction Value]),ALL(Table))
)
OR
Measure = 
divide(
calculate(sumx(Filter(Table,Table[Transaction Status] =1 ),Table[Transaction Value]),ALLEXCEPT(Table,Table[Transaction Status])),
calculate(sum(Table[Transaction Value]),ALL(Table))
)

 

az38
Community Champion
Community Champion

Hi @abosan 

try a measure

Measure = 
DIVIDE(
CALCULATE(SUM('Table'[Transaction Value]),ALLEXCEPT('Table','Table'[Transaction Status])),
CALCULATE(SUM('Table'[Transaction Value]),ALL('Table'))
)

 


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

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.