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

Filter into formula

Hi, could anyone help me with this problem..

 

I need to write formula witch takes filter value and used it in a formula. For example:

Filter of works: 

1. Work A

2. Work B

 

My formula should be: if (selected filter value is "work A", sum( all (table [random value])) * 0,7, if selected filter value is "work B", sum( all( table [random value])) * 0,3, blank () )

 

Thank a lot for the help!

1 ACCEPTED SOLUTION

Hi @Nathaniel_C,

Thanks for your help, but this didn't work for me, because in "myTable[column]" I have wrong data from accounting program. That's why if I choose A or B work I need to split all costs by proportion of 0,7 and 0,3.

 

I add my solution:

 

work costs = if(SELECTEDVALUE('2019 details'[Work])="work A";CALCULATE(SUM('2019 details'[SUM])*0,7;all('2019 details [work]); if(SELECTEDVALUE('2019 details'[Work])="work B";CALCULATE(sum('2019 details'[SUM])*0,3;all('2019 details '[Work]); CALCULATE(sum('2019 details'[SUM]);all('2019 details '[Work])

 

 

 

View solution in original post

3 REPLIES 3
Nathaniel_C
Super User
Super User

Hi @rutag ,

IF(myTable[column] = "work A", SUM(table[random value] *0,7,IF(myTable[column] = "work B", SUM(table[random value] *0,3)


Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel 





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

Proud to be a Super User!




Hi @Nathaniel_C,

Thanks for your help, but this didn't work for me, because in "myTable[column]" I have wrong data from accounting program. That's why if I choose A or B work I need to split all costs by proportion of 0,7 and 0,3.

 

I add my solution:

 

work costs = if(SELECTEDVALUE('2019 details'[Work])="work A";CALCULATE(SUM('2019 details'[SUM])*0,7;all('2019 details [work]); if(SELECTEDVALUE('2019 details'[Work])="work B";CALCULATE(sum('2019 details'[SUM])*0,3;all('2019 details '[Work]); CALCULATE(sum('2019 details'[SUM]);all('2019 details '[Work])

 

 

 

Icey
Community Support
Community Support

Hi @rutag ,

Glad to hear that. Please accept your reply as a solution so that people who may have the same question can get the solution directly.

 

Best Regards,

Icey

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.

Top Solution Authors