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

Context filters with "calculate" dax calculation

Hello,

 

I have created the following formula in Power BI to create a measure that gives me dollars at the levels I need. The calculation is similar to:

 

Revenue for buckets= CALCULATE(sum('table'[dollars]),
ALL('table'),
VALUES('table'[Customer ID),
VALUES('table'[Date]),
VALUES('table'[Channel])
)
 
This keeps the dollars at the level I want it. However, I want to be able to use filters in the filter pane using dimensions that are not a part of that calculation. When I add those to the aforesaid calculation, the results become inaccurate. I would like to know: Is there a function in Power BI similar to "context filters" in tableau that allow me to overwrite/use filters in the pane outside of the calculation? I want to be able to use different dimensions in the table as filters (via the filters pane) but not add them in the formula (as they mess up the output values for some reason). 
 
For context, I am also using this calculation to create a "revenue bucket" that places the dollars in pre-defined buckets as well as the count of customers in each bucket. 
 
Thank you for your time and assistance. 
6 REPLIES 6
amitchandak
Super User
Super User

@psahai06 , Not very clear to me

 

When you take all on table it will remove all the filters. For the same reason Power BI advice to have start schema.

It means in this case you should have three dimensions tables

Customer, Date, and Channel. And now take all on those tables.

https://docs.microsoft.com/en-us/power-bi/guidance/

 

Do you really need all , that you have to check

https://www.sqlbi.com/articles/managing-all-functions-in-dax-all-allselected-allnoblankrow-allexcept...

 

The other option you have is summarize. example

sumx(summarize(Table, 'Customer'[Customer ID],'Date'[Date],'Channel'[Channel],"_1",sum('table'[dollars])),[_1])

 

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

@AM I think I figured it out with your help. Thank you!

@psahai06 , who is AM ? 😀

parry2k
Super User
Super User

@psahai06 no single clue, what is your question? is this power bi or tableau question? I would advise you to read this post to get your answer quickly.

https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490



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.

IT is a power bi question. I am familiar with Tableau so I was trying to draw on the functionality that I am trying to recreate in power bi. 

 

Edit: Apologies for the confusing verbiage. I tried to make it clearer. I hope that clarified things a bit. @parry2k 

@psahai06 thanks for the clarification but still I recommend you read the post to get your answer. Although @amitchandak replied and seems like he got what you are trying to achieve but it not at all clear to me. I rather would like to understand the problem and provide a solution that makes sense and easy to digest rather than sharing few links. Good luck! You are in safe hands. 👍



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.

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