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
Anonymous
Not applicable

What-If Parameter to control delta values greater than

Hi,

 

Does anyone can help me on below where I can use what-if parameter to control delta values of selected SalesPerson and between his ProductSold? Thanks

 

2021-06-24_143540.jpg

1 ACCEPTED SOLUTION
v-jingzhang
Community Support
Community Support

Hi @Anonymous 

 

Create two measures as below. Use Flag measure as a visual-level filter on the table visual and set show items when the value is greater than 0.

Delta = 
VAR _minSold = CALCULATE(MIN('Table'[UnitsSold]),ALLEXCEPT('Table','Table'[SalesPerson],'Table'[ProductSold]))
VAR _maxSold = CALCULATE(MAX('Table'[UnitsSold]),ALLEXCEPT('Table','Table'[SalesPerson],'Table'[ProductSold]))
VAR _delta = _maxSold - _minSold
RETURN
_delta
Flag = [Delta] - [DeltaUnitsSold Value]

 

Attach the pbix for you to check the details.

 

I don't deal with the condition if there are 3 lines of ProductSold for a SalesPerson. Its expected result seems ambiguous. For example, if James has 3 lines data for Cable: 1, 11, 13. There are 3 delta values: 10, 12, 2. When setting DeltaUnitsSold as 10, only 12 is greater than it so the lines with 1 and 13 should display. But 10 and 2 is not greater than 10 so all related 3 lines should not display. I don't know how to deal with this.

 

Regards,
Community Support Team _ Jing
If this post helps, please Accept it as the solution to help other members find it.

View solution in original post

3 REPLIES 3
v-jingzhang
Community Support
Community Support

Hi @Anonymous 

 

Create two measures as below. Use Flag measure as a visual-level filter on the table visual and set show items when the value is greater than 0.

Delta = 
VAR _minSold = CALCULATE(MIN('Table'[UnitsSold]),ALLEXCEPT('Table','Table'[SalesPerson],'Table'[ProductSold]))
VAR _maxSold = CALCULATE(MAX('Table'[UnitsSold]),ALLEXCEPT('Table','Table'[SalesPerson],'Table'[ProductSold]))
VAR _delta = _maxSold - _minSold
RETURN
_delta
Flag = [Delta] - [DeltaUnitsSold Value]

 

Attach the pbix for you to check the details.

 

I don't deal with the condition if there are 3 lines of ProductSold for a SalesPerson. Its expected result seems ambiguous. For example, if James has 3 lines data for Cable: 1, 11, 13. There are 3 delta values: 10, 12, 2. When setting DeltaUnitsSold as 10, only 12 is greater than it so the lines with 1 and 13 should display. But 10 and 2 is not greater than 10 so all related 3 lines should not display. I don't know how to deal with this.

 

Regards,
Community Support Team _ Jing
If this post helps, please Accept it as the solution to help other members find it.

parry2k
Super User
Super User

@Anonymous what happens if there are same sales person and product sold has 3 line items? Define how to calculate the delta?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

@parry2k , I didnt thought about that. But i guess if there are 3 lines of ProductSold then get whichever the two delta which is greater than 10 or user selection  

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.