cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Tanushree_Kapse
Continued Contributor
Continued Contributor

Evaluating YTD for a particular category and Actuals for others

Hello,

 

I have a matrix with three fields in the rows... Level1, Level 2 and Level 3. And a Amount column. And a date slicer on the top.
I want my Amount column to show YTD for a particular value "212" in Level 3 and the Actuals for the date selected in slicer for rest of the vales of Level 3.
I am writing a DAX for a column:

Amount= If( level3= "212", TOTALYTD(SUM(AMT), Dates(Date)), AMT)

But it is not working.
What am I doing wrong?

 

1 ACCEPTED SOLUTION

For those who might be facing same issue:
I got the solutions for this:
Amount= IF(SELECTEDVALUE(level3)= "212", TOTALYTD(SUM(AMT), Dates(Date)), SUM(AMT))


Amount(fixed)= SUMX(VALUE(Level3), [Amount])


Pull this Amont(fixed) measure in your Matrix and you will get the desired Total.

View solution in original post

3 REPLIES 3
amitchandak
Super User IV
Super User IV

@Tanushree_Kapse , Try like

 

Amount= If( max(Table[level3])= "212", TOTALYTD(SUM(Table[AMT]), Dates(Date)), sum(Table[AMT]))



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Hi @amitchandak ,
No that didn't work, gave the same results as before.
I rather created a measure for this :
Amount= IF(SELECTEDVALUE(level3)= "212", TOTALYTD(SUM(AMT), Dates(Date)), SUM(AMT))
It gave me YTD value for 212, but now the Matrix Total at bottom is not correct, it is still giving me the older one not the one with 212's YTD.
What can be done for this?

 

For those who might be facing same issue:
I got the solutions for this:
Amount= IF(SELECTEDVALUE(level3)= "212", TOTALYTD(SUM(AMT), Dates(Date)), SUM(AMT))


Amount(fixed)= SUMX(VALUE(Level3), [Amount])


Pull this Amont(fixed) measure in your Matrix and you will get the desired Total.

View solution in original post

Helpful resources

Announcements
PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Get Ready for Power BI Dev Camp

Microsoft named a Leader in The Forrester Wave

Microsoft received the highest score of any vendor in both the strategy and current offering categories.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (718)