Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Divide filter

Hi,
 
I have a calculation of dividing a measure by a measure:
 
Total Breached % =
DIVIDE([Total Breached],[Count of Incidents]) + 0
 
I want to exclude a certain value that is attached to certain rows of data. What would the dax formula be for the divide but filter on the value?
 
Thanks
 
Liam
1 ACCEPTED SOLUTION
Anonymous
Not applicable

You have not closed bracket of calculate.

 

Try this

 

Divide% = Divide(
Calculate([Total Breached],filter(table,table[Key]<>"471")),[Count of Incidents])
 

Thanks & regards,
Pravin Wattamwar
www.linkedin.com/in/pravin-p-wattamwar

If I resolve your problem Mark it as a solution and give kudos.

check my blog here
https://community.powerbi.com/t5/Community-Blog/Connecting-to-a-Tabular-Model-Using-Power-BI/ba-p/91...

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Divide(
Calculate([measure],filter(table,table[col]="value"),[measure2])

Thanks
Pravin

If it resolves your problem mark it as a solution and give Kudos.
Anonymous
Not applicable

Hi @Anonymous ,

 

Thanks for your reply.

 

I currently have:

 

Divide% = Divide(
Calculate([Total Breached],filter(table,table[Key]<>"471"),[Count of Incidents]).
 
This says too few arguments were passed to the divide function. The minimum is 2?
 
Thanks in advance
 
Liam
Anonymous
Not applicable

You have not closed bracket of calculate.

 

Try this

 

Divide% = Divide(
Calculate([Total Breached],filter(table,table[Key]<>"471")),[Count of Incidents])
 

Thanks & regards,
Pravin Wattamwar
www.linkedin.com/in/pravin-p-wattamwar

If I resolve your problem Mark it as a solution and give kudos.

check my blog here
https://community.powerbi.com/t5/Community-Blog/Connecting-to-a-Tabular-Model-Using-Power-BI/ba-p/91...

Anonymous
Not applicable

Hi @Anonymous ,

 

Thankyou, it now accepts this.

 

I have both calculations next to each other in my matrix but the first divide displays all of the % as expected, but the new formula to filter out one of the rows, or display it as 0, displays blank on the whole column. Ive attached an image. 

 

DAX.png

 

 

Would you have any idea why it displays like this?

 

Thanks again for your help with this

 

Liam

 

 

Anonymous
Not applicable

debug your measure.

 

First check which measure is showing blank in divide and why.

Check is there any value other than 471 also check data type of column. you add 471 in (""). Hence it is taking it as string. 471 only for int.

 

Thanks & regards,
Pravin Wattamwar
www.linkedin.com/in/pravin-p-wattamwar

If I resolve your problem Mark it as a solution and give kudos.

check my blog here
https://community.powerbi.com/t5/Community-Blog/Connecting-to-a-Tabular-Model-Using-Power-BI/ba-p/91...

Anonymous
Not applicable

Thanks for your help with this @Anonymous . After playing around with the formatting its managed to show up as expected.

 

Thanks

 

Liam

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

Top Solution Authors