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
401evolr
Helper II
Helper II

Filter/slicer problems with calculated columns?

I'm trying to apply filters or slicers to my data in the report view without luck. Might have something to do with calculated columns?

 

I have one table that is a list of work for the year (2266 jobs total across all 'programs' and 'areas'):

 

PBI1.png

 

I created a second table (with all calculated columns) to calculate how many jobs need to be done each day such that they're all complete by end of year. Then you can see how many jobs should be remaining on each calendar day. This is shown by the target 'Burndown' column:

 

PBI2.png

 

In the report view, this target burndown line plots nicely (showing 2266 jobs on Jan 1 and 0 on Dec 31). However, I'm trying to add filters or a splicer so that I can see a burndown line only for jobs with a certain "program" or "area" attribute. As you can see, I've set up a filter to show only "south" areas and "instrument" programs - yet the burndown line remains unchanged.

 

PBI3.png

 

Is there a reason the filters aren't applying to my calculated columns?

12 REPLIES 12
amitchandak
Super User
Super User

@401evolr , is this new table joined with your dimension table, so that filter can apply

Yes, here are the relationships I have set up:

 

PBI4.png

Thanks for the replies @nandukrishnavs and @amitchandak 

Changing the relationship to "bi-directional", I'm able to filter it somewhat, but it's incorrect. It changes the date along the x-axis, whereas I'm expecting it to change the number of jobs shown along the Y-axis:

 

PBI6.png

PBI5.png

Keep your relationship going one way (the original way you had it), and try a measure like this:

 

NewMeasure = Calculate(AVERAGE(GovtExchangesBurndown[Burndown]), GovtExchangesAll)

 

Since you are using the many table in the calculate, it will honor the slicer affecting that table.  This is one way to make filters flow "uphill".

 

If this works for you, please mark it as solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Thanks @mahoneypat 

The new measure gives me the same result as before unfortunately. The filters are having an effect on the dates, but not the intended fields:

 

PBI6.png

Icey
Community Support
Community Support

Hi @401evolr ,

 

Please create a dummy pbix file for test. Please remove sensitive information and replace real data with dummy data. It is suggested to upload your file to OneDrive for Business and then paste the link here.

 

 

Best Regards,

Icey

Thanks @Icey 
Here is the link to the pbix file. Let me know if it doesn't work.

Icey
Community Support
Community Support

Hi @401evolr ,

 

Sorry to reply late. 

First, filters or slicers can't dynamically change the result of calculated column / table.

Then, try to create a measure like so:

Measure =
VAR AnnualCount_ =
    CALCULATE (
        COUNT ( GovtExchangesAll[Status] ),
        ALLSELECTED ( GovtExchangesAll )
    )
VAR DailyTarget_ = AnnualCount_ / 365
VAR YTDTarget_ =
    CALCULATE ( SUM ( GovtExchangesBD[DailyTarget] ), DATESYTD ( DimDate[Date] ) )
VAR Burndown_ = AnnualCount_ - YTDTarget_
RETURN
    AVERAGEX ( GovtExchangesBD, Burndown_ )

measure.gif

 

 

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@Icey thanks for your reply. It looks like this measure will indeed allow for dynamic filtering. However, it's calculating it incorrectly. Notice that the year-end numbers are negative when the filtering is applied - but they should always be 0.

 

I think what's happening is that the function to calculate the Daily Target is not being filtered. For example, there are 1000 total items so the daily burndown is 1000/365 = 2.7. However, if we filter the type to just "instruments", there are 142 total items so the daily burndown should be 142/365 = 0.4. But, it keeps applying the 2.7 instead.

 

Is there a way to have the Daily Target function be dynamic as well?

@mahoneypat thanks for the reply. I don't quite follow - where would i use this new measure?

Your first post showed the average of burndown in the Line Values area of your chart.  You can try this measure there.

 

If this works for you, please mark it as solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


nandukrishnavs
Super User
Super User

@401evolr 

 

 

You have to enable the relationship between these two tables.



Did I answer your question? Mark my post as a solution!
Appreciate with a kudos
🙂


Regards,
Nandu Krishna

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.