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

Dynamic inputs

I am building a report in Power BI which shows the details of sales opportunities being pulled from our CRM which are forecast to close that month.


Currently we have a weekly team meeting where we go through each opportunity in an Excel spreadsheet with the sales reps and assign each opportunity with one of three categories: Will make the sale, Might make the sale and Won't make the sale. This allows us to forecast our revenues for the month.

 

We are trying to transition to Power BI, is there a way to assign a value to each opportunity in Power BI using a custom visual or power app so we can run calculations based on these inputs? 

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

Hi  @jacobsutcliffe  ,
You can use the switch() function to label them as required

According to your description, I create this data:

v-yangliu-msft_0-1615358455336.png

Custom rules:

Every week, Good and Bad of the same Opportunity are added together,

If it is greater than 0, it means Will make the sale

If it is equal to 0, it is May make the sale

If it is less than 0, it is Not make the sale

 

Here are the steps you can follow:

1. Create calculated column.

Week = WEEKNUM('Table'[date])
Categories =
var _flag=
SUMX(FILTER('Table','Table'[Week]=EARLIER('Table'[Week])&&'Table'[Opportunity]=EARLIER('Table'[Opportunity])),'Table'[Good]+'Table'[Bad])
return
SWITCH(
    TRUE(),
    _flag>0,"Will make the sale",
    _flag=0,"May make the sale",
    _flag<0,"Not make the sale")

2. Result:

v-yangliu-msft_1-1615358455354.png

You can downloaded PBIX file from here.

 

If the result is not correct as you expected, can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

what are the rules defined by the three categories.

 

Best Regards,

Liu Yang

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

1 REPLY 1
v-yangliu-msft
Community Support
Community Support

Hi  @jacobsutcliffe  ,
You can use the switch() function to label them as required

According to your description, I create this data:

v-yangliu-msft_0-1615358455336.png

Custom rules:

Every week, Good and Bad of the same Opportunity are added together,

If it is greater than 0, it means Will make the sale

If it is equal to 0, it is May make the sale

If it is less than 0, it is Not make the sale

 

Here are the steps you can follow:

1. Create calculated column.

Week = WEEKNUM('Table'[date])
Categories =
var _flag=
SUMX(FILTER('Table','Table'[Week]=EARLIER('Table'[Week])&&'Table'[Opportunity]=EARLIER('Table'[Opportunity])),'Table'[Good]+'Table'[Bad])
return
SWITCH(
    TRUE(),
    _flag>0,"Will make the sale",
    _flag=0,"May make the sale",
    _flag<0,"Not make the sale")

2. Result:

v-yangliu-msft_1-1615358455354.png

You can downloaded PBIX file from here.

 

If the result is not correct as you expected, can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

what are the rules defined by the three categories.

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.