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

Is it possible to toggle the filter inside CALCULATE on and off?

Hi,

I am curious if it is possible to toggle one of the filters in Calculate for different reports.

Here is my measure:

LYDaySales = CALCULATE([SumSales]
            , DATESBETWEEN(vwCTSKUSales[FinalDate], min('Calendar'[LY 364]), MAX('Calendar'[LY 364]))
            , vwCTSKUSales[ProdGroupCalc] in values(vwCTSKUSales[ProdGroupCalc])
            , vwCTSKUSales[BuyerCalc] in values(vwCTSKUSales[BuyerCalc])
            , vwCTSKUSales[MajorCode] in values(vwCTSKUSales[MajorCode])
            , vwCTSKUSales[Region] in values(vwCTSKUSales[Region])
            //, vwCTSKUSales[VendorCode] in values(tbl_SKUBasic[VendorCode])  <--- Toggle
            , ALL(vwCTSKUSales)
            )

Thanks!
5 REPLIES 5
parry2k
Super User
Super User

@Anonymous if somehow you identify (may be with parmeter) which report you are in then you can put condition in the logic to change filter.



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

Hi!

Thanks for the response.

I did attempt to insert an IF statement, if (isblank(....),,) but it didn't do anything.

How to identify a report in power bi?  I am assuming like in Excel, I need to get the sheet name (?)

sokg
Solution Supplier
Solution Supplier

Why don't you create 2 measures and use each one in each report you want??

Anonymous
Not applicable

The end users don't like the idea on an already large report. 

I also tried creating a manual table to determine which measure to use with success, but the users pushed back on that idea as well.  Thus, I am resorting to this forum for alternatives.

 

sokg
Solution Supplier
Solution Supplier

Please look a technique described at the video link below

 

https://www.youtube.com/watch?v=Ua3PyCTIAHM

 

Hopefully this is what you are looking for!

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.