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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
jdw_msft
Frequent Visitor

Get MTD/YTD from only last date of the month and add to total MTD/YTD if the current is not finished

Hello everyone, i have data source that come like this:

month januarymonth januarymonth marchmonth marchmonth februarymonth februarymonth aprilmonth april

the visual slicerthe visual slicer

 

 

 

 

 

mtdmtdytdytd

 

I want to get MTD only from last date of the month (from sales_running_sum column, i.e. 31/01/2024 is 104, etc.) or latest date from current month/current year and also sum YTD from MTD. And if the the month is not finished it'll be added to running MTD and YTD too. And also the slicer is divided into three sections (date, month, and year)

 

Is there any solution that can i implement it?

 

 

 

1 ACCEPTED SOLUTION
Selva-Salimi
Super User
Super User

Hi @jdw_msft ,

 

you can write the measures like:

 

MTD := calculate(sum(sales_running_sum), filter(table, date=max(date)))

and

YTD := var tbl1=summarize(table, year(date),month(date), "mtd",maxx(filter(table,date=max(date)),sales_running_sum));

             retrun sumx(tbl1,mtd)

 

If this post helps, then I would appreciate a thumbs up  and mark it as the solution to help the other members find it more quickly. 

View solution in original post

2 REPLIES 2
Selva-Salimi
Super User
Super User

Hi @jdw_msft ,

 

you can write the measures like:

 

MTD := calculate(sum(sales_running_sum), filter(table, date=max(date)))

and

YTD := var tbl1=summarize(table, year(date),month(date), "mtd",maxx(filter(table,date=max(date)),sales_running_sum));

             retrun sumx(tbl1,mtd)

 

If this post helps, then I would appreciate a thumbs up  and mark it as the solution to help the other members find it more quickly. 

I try to implement it and it doesn't work like i'm expected.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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