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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

filtered month and ytd table

Hey,

 

I am relatively new to powerbi.

 

Is there a way i can show a table of data filtered by month, but only showing a specific month and year to date total. When I filter my table to current month, the total is also showing current month's data. 

 

alwpaul_0-1652708362217.pngalwpaul_2-1652708464895.png

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

You want to show the year-to-date values in the total, and only the selected month's value in the month.

I have a doubt whether the year to date ends on the selected month, or on the current date.

Below are the results for the year to the selected month.

Measure = var _total=TOTALYTD(SUM('Table'[Value]),'CALENDAR'[Date])
return IF(ISINSCOPE('CALENDAR'[Month]),SUM('Table'[Value]),_total)

vstephenmsft_1-1652949447101.png

vstephenmsft_2-1652949455558.png

Below are the results for the year to the current date(today).

Measure2 = var _total=CALCULATE(SUM('Table'[Value]),FILTER(ALL('CALENDAR'),YEAR([Date])=YEAR(TODAY())&&[Date]<=TODAY()))
return IF(ISINSCOPE('CALENDAR'[Month]),SUM('Table'[Value]),_total)

 

vstephenmsft_3-1652949679120.png

vstephenmsft_4-1652949686582.png

You can check more details from my attachment.

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,

 

You want to show the year-to-date values in the total, and only the selected month's value in the month.

I have a doubt whether the year to date ends on the selected month, or on the current date.

Below are the results for the year to the selected month.

Measure = var _total=TOTALYTD(SUM('Table'[Value]),'CALENDAR'[Date])
return IF(ISINSCOPE('CALENDAR'[Month]),SUM('Table'[Value]),_total)

vstephenmsft_1-1652949447101.png

vstephenmsft_2-1652949455558.png

Below are the results for the year to the current date(today).

Measure2 = var _total=CALCULATE(SUM('Table'[Value]),FILTER(ALL('CALENDAR'),YEAR([Date])=YEAR(TODAY())&&[Date]<=TODAY()))
return IF(ISINSCOPE('CALENDAR'[Month]),SUM('Table'[Value]),_total)

 

vstephenmsft_3-1652949679120.png

vstephenmsft_4-1652949686582.png

You can check more details from my attachment.

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

@Anonymous This works perfectly, thank you!!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.