Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
bhurru
Helper I
Helper I

Dynamic filter condition of a measure

Hi, I have couple of measures like Calculate(<expr>,Datesinperiod(CalenderDate,<startDate>,Number of interval,Interval)).

Also I have time period slicer having 4 values

8Weeks

26 Weeks

2 Quarters

24 Months

Now I want above measure to dynamically change DatesinPeriod filter according to the TimePeriod Slicer selection user make.

 

I know one approach by creating measures for all time period and then using Selectedvalue make them dynamic. This is all throughout the communities. My problem is by this approach I  have to create 16 measures for one metric and there are 6 metric.  

 

16 measures for one metric as in When user select 8 Weeks from Time Period slicer, then I need to show Curr4Weeks, Prev4Weeks,Delta and %Change. Hence 4*4(4 time period) = 16. 

 

Is it possible to only make this happen by dynamically writing DatesinPeriod filter condition in measure definition in some way ? Or if there is some other way to achieve this.

 

 

2 REPLIES 2
vanessafvg
Super User
Super User

switch statement() might work

https://www.thedataschool.com.au/danica-hui/switching-measures-and-titles-dynamically-in-power-bi/




If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.