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
JUSEGAPO
Regular Visitor

¿How i can make calculation including filters?

Hi everyone,

 

Im new on it platform, i was working on Qlik platforms but in this moment we need to use Power BI. 

 

I need to calculate percetage of execution, so i have it information:

 

Numero ticketEstadoProyectoRegion
Ticket1WaitingProject1Region1
Ticket2WaitingProject1Region1
Ticket3WaitingProject1Region1
Ticket4ClosedProject1Region1
Ticket5WaitingProject1Region1
Ticket6WaitingProject1Region1
Ticket7WaitingProject1Region1
Ticket8ClosedProject1Region2
Ticket9WaitingProject1Region2
Ticket10WaitingProject1Region2
Ticket11WaitingProject1Region2
Ticket12ClosedProject1Region2
Ticket13ClosedProject1Region2
Ticket14ClosedProject1Region3
Ticket15ClosedProject1Region3
Ticket16ClosedProject2Region3
Ticket17ClosedProject3Region3

 

I need make a formula to obtain the next values:

 

Formule 1: Total Ticket closed/total tickets (Project 1 and region 1)

Formule 2: Total ticket closed/total tickets (project 1 and region 2)

Formule 3: total ticket closed/total tickets (project 1 and region 3)

 

Expected values:

 

Formule 1: 1/7  14%

Formule 2: 3/6  50%

Formule 3: 2/2  100%

 

Thanks in advance...!!! 

 Smiley Very Happy

1 ACCEPTED SOLUTION
GilbertQ
Super User
Super User

Hi @JUSEGAPO

 

You can do it with the following measures below. 

NOTE: My table is named 'Table1'

 

Tickets = COUNTROWS('Table1')

Tickets Closed = CALCULATE([Tickets],'Table1'[Estado] = "Closed")

Tickets Closed % = DIVIDE([Tickets Closed],[Tickets])

I then put in a slicer for Proyecto and I got the following result when slicing on Project1

 

A-PBI Community.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

View solution in original post

3 REPLIES 3
GilbertQ
Super User
Super User

Hi @JUSEGAPO

 

You can do it with the following measures below. 

NOTE: My table is named 'Table1'

 

Tickets = COUNTROWS('Table1')

Tickets Closed = CALCULATE([Tickets],'Table1'[Estado] = "Closed")

Tickets Closed % = DIVIDE([Tickets Closed],[Tickets])

I then put in a slicer for Proyecto and I got the following result when slicing on Project1

 

A-PBI Community.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

Hi @GilbertQ,

 

Thanks a lot!!! It works.

 

Can you explain me how i can make more than 1 filter in the same formula? For example, make filter in "Estado" with "Closed" and "Finish"?

 

 

Thanks in advance.

Sure not a problem at all.

 

To have multiple conditions you can modify it as shown below from the Original Measure

 

 

Tickets Closed = CALCULATE([Tickets],'Table1'[Estado] = "Closed" && [Tickets],'Table1'[Estado] = "Finish")

The && represents and, so it is saying where tickets are "Closed and Finish"

 

If you want to use OR then use the || which will then say tickets are "Closed or Finish"





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

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.