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

Make matrix show data until current year of prior, and still be able to filter it by year.

Hello everyone, 

I am trying to have a matrix show data of current year or prior. First I tried to filter the data by the Year field through the filter pane like so: 

eugeniaCastilla_0-1648117195244.png

But apparently this is something that you can't do, so then I created a calculated column in my table as follows: 

AnioFiltr = if(COSTES_MEDIOS_RADIO[ANIO]<=YEAR(TODAY()),COSTES_MEDIOS_RADIO[ANIO])
 
Now this is fine, except for when a filter selection is made under the ANIO field. In that case, the matrix shows the selected years with thata, but also the years not seleced BLANK. I then tried to fix this by saying, OK, so I will make a filter condition so that the matrix only shows those AnioFiltr that are not null:
eugeniaCastilla_1-1648117377941.png

 

, but it does nothing, can anyone help me??
 
PD: the field used to filter the matrix is ANIO from a seperate calendar table:
eugeniaCastilla_2-1648117470891.png

As ou can see in the image, the ANIO in table "AÑO-MES" is the one field used in the filter, and the field AnioFiltr is from the table that has the data and is being displayed in the matrix.

 
Thanks in advance! 
2 REPLIES 2
v-shex-msft
Community Support
Community Support

Hi @Anonymous,

I'm not so clear with your description, did you mean the matrix shows the records until the current year period by default and it can be reset by filter effect to show corresponding records?

If that is the case, I'd like to suggest writing measure formulas with isfiltered function and applying on 'visual level filter' to filter records. (current power bi does not support creating dynamic calculated column/table based on filter effects because they are working on the different levels and you can't use child level to effect its parent)

Applying a measure filter in Power BI - SQLBI

ISFILTERED, ISCROSSFILTERED – DAX Guide - SQLBI

Notice: the data level of power bi.

Database(external) -> query table(query, custom function, query parameters) -> data model table(table, calculate column/table) -> data view with virtual tables(measure, visual, filter, slicer)

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
davehus
Memorable Member
Memorable Member

Hi @Anonymous , Have you an example of the actual report so that I can see what's happening or not happening?

 

Thanks

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.