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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
NewbieJono
Post Partisan
Post Partisan

year to date

Hello, i want to show a chart which shows the volumes of YTD (starting 1st April) going back in time. so for today it would shows

 

Bar 1 - 1st April 2024 - 21st April 2024

Bar 2 - 1st April 2023 - 21st April 2023

Bar 3 - 1st April 2022 - 21st April 2022

1 ACCEPTED SOLUTION

same logic for each bar you want to display

 

Dax Measure:

 Volume from 1st April 2024 to 21st April 2024 =

CALCULATE( SUM(YourData[Volume]), 

      DATESBETWEEN(

              Date[Date], 

              DATE(2024, 4, 1),

              DATE(2024, 4, 21)
))




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!




View solution in original post

6 REPLIES 6
ryan_mayu
Super User
Super User

@NewbieJono 

pls try this

Column =
var _date=if(month('Table'[Date])=month(today())&&day('Table'[Date])<=day(today()),1)
return if(_date=1, "1st"&format('Table'[Date],"mmmm")&year('Table'[Date])&"-"&day(today())&format('Table'[Date],"mmmm")&year('Table'[Date]))
11.PNG
 




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




i would just like to flag 1 in the column, not display a date. thanks for your help

then try this

Column =if(month('Table'[Date])=month(today())&&day('Table'[Date])<=day(today()),1)




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




NewbieJono
Post Partisan
Post Partisan

how would i calculate these values

same logic for each bar you want to display

 

Dax Measure:

 Volume from 1st April 2024 to 21st April 2024 =

CALCULATE( SUM(YourData[Volume]), 

      DATESBETWEEN(

              Date[Date], 

              DATE(2024, 4, 1),

              DATE(2024, 4, 21)
))




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!




Alex87
Super User
Super User

Hello,

You can use a clustered column chart. Calculate the values for each bar in separe DAX and choose the order you want for display

 

 




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!




Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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

Top Kudoed Authors