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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Danteee
Regular Visitor

Dax for dynamically show the last 12 months data in a visual

Hi team,

I am new to Power BI and i have created a column chart where I have a single data table for the past 2 years,i only needed the last 12 months data to show in the chart dynamically to my client

 This is my visual

Danteee_1-1695279945640.png

I have created a dax measure for this one

Danteee_2-1695279976199.png

I created this measure and inserted into values in the chart but however i am getting all the data for the past two years. Can anybody help me on this

1 ACCEPTED SOLUTION
JoeBarry
Solution Sage
Solution Sage

Hi @Danteee 

 

  • Add the Total Values measure to your visual.
  • Highlight your visual
  • Within the filter pane on the right of your screen, add the date column from your table to the filter, this won't add the date to your visual
  • Choose Relative date from the dropdown, and choose in the last 12 months

 

Hope this helps

Joe

 

If this post helps, then please Accept it as the solution

View solution in original post

4 REPLIES 4
Danteee
Regular Visitor

Thanks @JoeBarry for your help i will accept your reply as my solution, much appreciated.

Danteee
Regular Visitor

Hi @JoeBarry 

I have added the total measure in the visual and also added the date in the filter pane selected "is in the last 12 months" and it shows till Oct only, may i know why its showing till oct only

Danteee_0-1695282073220.png


Thanks in advance

Hi @Danteee 

 

Does your table have data from 21/09/2022 to the 30/09/2022? I would say October has data and in the context of the last 12 months including today, then October is correct if there is no data in the range mentioned

JoeBarry
Solution Sage
Solution Sage

Hi @Danteee 

 

  • Add the Total Values measure to your visual.
  • Highlight your visual
  • Within the filter pane on the right of your screen, add the date column from your table to the filter, this won't add the date to your visual
  • Choose Relative date from the dropdown, and choose in the last 12 months

 

Hope this helps

Joe

 

If this post helps, then please Accept it as the solution

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors