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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

filter function charts

I have a bar graph, I need it to work as follows: By selecting any year in the filter values to be displayed in the chart must be the values of all previous years and it takes place a Texo box or similar Meeting that presents the total value of values by the year selected in the filter.

 

it is possible to do this in Power BI? if it is not possible to make a bar graph with what type of chart is possible I do this?

 

is an example of how I want to leave my graph:

 

Untitled.png

4 REPLIES 4
Anonymous
Not applicable

Hi vitexo87,

According to your description, you want to get the records filtered by date is equal or less than your choice in slicer, right?

 

Below is my test steps:

 

 1. Create test tables.

'Sales Amount Records':

 Capture.PNG

 

‘CalendarTable’:

Dax: CalendarTable = ADDCOLUMNS( CALENDAR(MIN('Sales Amount Records'[Date]),MAX('Sales Amount Records'[Date])),"Year",YEAR([Date]),"Month",MONTH([Date]))

 Capture1.PNG

 

Relationship(Date):

Capture5.PNG

 

 2. Add measures to table.

‘Sales Amount Records’:

Não Processado = sum('Sales Amount Records'[Nao])

Processado = sum('Sales Amount Records'[Processado ])

 

‘CalendarTable’(Use to get the value of slicer):

Slicer Choice = if(HASONEVALUE(CalendarTable[Year]),MAX(CalendarTable[Year]),BLANK())

 

 3. Create a table get data from slicer.

Dax: CALCULATETABLEBYSlicer = CALCULATETABLE('Sales Amount Records',FILTER('Sales Amount Records',YEAR('Sales Amount Records'[Date]) <=[Slicer Choice]))

 

 4. Create visuals.

Slicer Year:

 Capture3.PNG

Slicer Month:

 Capture4.PNG

 

Current choice records:

 Capture6.PNG

 

Capture7.PNG

 

Requirement table:

 Capture8.PNG

Capture9.PNG

 

Test result:

Capture2.PNG

 

In summary, I found that the data which choice in slicer can’t alternately with the created table. When the dax formula initialization the table, the measure(‘Slicer Choice’) is blank. (it can’t get the value which selected in the slicer). The table’s structure will be fixed after initialization.

 

To work around the issue, you can use below two methods:

 a. Use the page level filter with “is on or before” operator

 Capture10.PNG

Capture11.PNG

 

 b. Use Timeline slicer.

 

Regards,

Xiaoxin Sheng

Anonymous
Not applicable

@Anonymous

 

I already had a calendar table, however I can not relate to any other table because the ano_id that would be the key doubles

I was trying to create a column in my Year table every time it was the year of filter values to be displayed by this new column was every year until the filtrate year.

 

i try create conditional columns, measurement, custom column but without success

Anonymous
Not applicable

Hi vitexo87,

 

>>By selecting any year in the filter values to be displayed in the chart must be the values of all previous years and it takes place a Texo box or similar Meeting that presents the total value of values by the year selected in the filter.

 

The slicer not support within feature, you can use 'page level filter' or 'timeline slicer' to achieve your requirement.


For detail info, you could refer to my previous reply.

 

Regards,

Xiaoxin Sheng

Anonymous
Not applicable

the expression that is being used in this graph

 

Não Processado = sum(Fatos[Vl_RestoNaoProcessado])

 

Processado = sum(Fatos[Vl_RestoProcessado])

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors