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
Paulyeo11
Impactful Individual
Impactful Individual

How to create a measure to filter sales >1000 ?

Hi All

I have a pivot table , i like to filter those customer buying amount > 1000

Paulyeo11_0-1608591300332.png

https://www.dropbox.com/s/0w75spv54l79ar1/PBT_V01021%20Show%20customer%20buying%20more%20then%201000...

Above is my PBI file

 

Paul

2 ACCEPTED SOLUTIONS
AlB
Super User
Super User

@Paulyeo11 

See it all at work in the attached file.

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

 

SU18_powerbi_badge

View solution in original post

@Paulyeo11 you need to use this measure in your visual instead of filtering on it, see attached.

 

 



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.

View solution in original post

8 REPLIES 8
parry2k
Super User
Super User

@Paulyeo11 Thanks! I would avoid using a visual level filter using measures but rather create measures (the way we did in this example) and now you can use this measure in many visuals.

 

Glad it worked out for you 👍 Cheers!

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



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.

parry2k
Super User
Super User

@Paulyeo11 there are already good solution, here is an optimized DAX

 

Sales Above Limit Only = 
VAR __limit = 1000 --set a limit
RETURN
SUMX (  
    SUMMARIZE ( --summarize sales by customer
        SALES, 
        SALES[COMPANY], 
        "__Sales", [SALES_] 
    ),  
    IF ( [__Sales] > __limit, [__Sales] ) --return Sales where Sales is greater than limi 
)

 

And output will be:

 

image.png

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



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.

@Paulyeo11 you need to use this measure in your visual instead of filtering on it, see attached.

 

 



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.

Paulyeo11
Impactful Individual
Impactful Individual

Hi Parry

Now i learn one more new approach. This is even better , don't need to add expression at filter. 

Thank you very much. Also your scipt very neat.

Paul Yeo

Paulyeo11
Impactful Individual
Impactful Individual

Hi Parry

Thank you for sharing the expression.

I try to use your expression on my PBI file below , it return null

https://www.dropbox.com/s/fmvuj62gyfwmfib/How%20to%20create%20a%20measure%20to%20filter%20sales%20gr...

 

amitchandak
Super User
Super User

@Paulyeo11 , Create a measure

Measure = sumx(FILTER(SUMMARIZE(SALES,SALES[COMPANY], "_1", CALCULATE([SALES_], ALLEXCEPT(SALES,SALES[COMPANY])) ,"_2",[SALES_]),[_1] >1000),[_2])

 

File attached after signature

 

like

 

AlB
Super User
Super User

@Paulyeo11 

See it all at work in the attached file.

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

 

SU18_powerbi_badge

AlB
Super User
Super User

Hi @Paulyeo11 

You can create a measure to filter the visual

1.  Create this measure:

ShowMeasure =
VAR salesTotal_ =
    CALCULATE ( [SALES_], ALL ( SALES[BRAND] ) )
RETURN
    IF ( salesTotal_ > 1000, 1, 0 )

 2.  Place [ShowMeasure] as a visual filter and choose to show when value is 1

 

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

 

SU18_powerbi_badge

 

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