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
alwpaul
Frequent Visitor

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
v-stephen-msft
Community Support
Community Support

Hi @alwpaul ,

 

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
v-stephen-msft
Community Support
Community Support

Hi @alwpaul ,

 

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.

@v-stephen-msft This works perfectly, thank you!!

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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