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
kanth123
Helper I
Helper I

Filter data based on Sales Price

Hi,

 Created a calculated Measure "Flag"  based on below logic . User can choose either Include or Exlcude. 

Unit Price  =  Sum(Amount)/Sum(Units)

 Flag = if [Unit Price] > 25,"Include","Exlcude" . 

 

Flag is working as expected when Product and Account are present in visualization. 

DateSales RepRegionAccountProductAmountUnitsUnitPrice (Amount/Units)
1/1/2022MattEast1004A200540
1/1/2022MattEast1004B100520
1/1/2022AlexWest1002C150350
1/2/2022DavidSouth1003D1001100
1/2/2022MattEast1003D2002100
1/2/2022AlexWest1004A100250

 

Above flag is not working in this case. expected Amount for Matt is 400 but its showing 500. Any suggestions to fix flag. 

 

RegionSales RepSalesExpected amount
EastMatt500400
WestAlex250250
SouthDavid100100

 

Thanks in advance. 

 

1 ACCEPTED SOLUTION

Hi @kanth123 

Please try using this measure for the flag

Flag = CALCULATE(SUM('Units'[Amount]),FILTER(Units,'Units'[UnitPrice] > 25))

Kind regards,
Seanan
If this post helped, please consider accepting it as the solution.

View solution in original post

6 REPLIES 6
Seanan
Solution Supplier
Solution Supplier

Hi @kanth123 

Would you be able to share the code for your RepSales measure?

@Seanan  

Unit Sales Price - Amount/Units

Hi @kanth123 

Please try using this measure for the flag

Flag = CALCULATE(SUM('Units'[Amount]),FILTER(Units,'Units'[UnitPrice] > 25))

Kind regards,
Seanan
If this post helped, please consider accepting it as the solution.

Hi @Seanan 

tried filter option in measure. Its giving different values when Account and product are removed from visual. 

Wanted to apply filter at Visual or Page level to filter data. 

Hi @kanth123 

In my table the measure seems to be working fine.

NVIDIA_Share_qVzpXGDMFW.png

 

 

 

 

Is this the result you were looking for?

If not could you please explain further what you require the measure to display and how you intend to use it.

Hi @Seanan .. 

 

Thankyou for quick response.. 

Modified the approach in implementing flag. 

 

Thanks..

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.