cancel
Showing results for
Did you mean:

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a \$100 discount. Register Now

Helper II

## TOTALYTD Total in Table

 DATE COUNTS COUNTS TYTD 2021-03 30 89 2021-02 28 59 2021-01 31 31 2020-12 26 323 2020-11 24 297 2020-10 42 273 2020-09 31 231 2020-08 22 200 2020-07 32 178 2020-06 31 146 2020-05 12 115 2020-04 21 103 2020-03 28 82 2020-02 23 54 2020-01 31 31 TOTAL 412 89

I need to total the TOTALYTD value over multiple years. The value is correct for each year but I need the table to return the total of each year and not just the current years YTD total. I would like it to return 412 instead of 89 ( 89 + 323).

1 ACCEPTED SOLUTION
Super User

Hi, @NickTT

The sample pbix file's link is down below.

Counts TYTD FIX =
SUMX( VALUES('Date'[Year]), TOTALYTD([Counts Total], 'Date'[Date]))

Hi, My name is Jihwan Kim.

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.

4 REPLIES 4
Helper II

That works correctly in a Matrix but what about Table? In a Table it's returning the same row values as COUNTS.

Super User

Hi, @NickTT

The sample pbix file's link is down below.

Counts TYTD FIX =
SUMX( VALUES('Date'[Year]), TOTALYTD([Counts Total], 'Date'[Date]))

Hi, My name is Jihwan Kim.

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.

Helper II

That did the trick!

Super User

@NickTT , use isinscope or isfiltered and change measure to simple sum

if(isinscope(Date[Date]), [COUNTS TYTD], [COUNTS])

or

if(isfiltered(Date[Date]), [COUNTS TYTD], [COUNTS])

https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/

https://powerpivotpro.com/2013/03/hasonevalue-vs-isfiltered-vs-hasonefilter/

Announcements

#### Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

#### Power BI Monthly Update - February 2024

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

#### Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

#### Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors
Top Kudoed Authors