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
spartanboy
Helper II
Helper II

Recalculate Total Sum by a given critera

Hello - 

How to customize Total? here the requirement is to sum only the highlighted rows to get row total

 

spartanboy_0-1658162673473.png

Thanks,

3 REPLIES 3
pranit828
Community Champion
Community Champion

Hi @spartanboy 

Try

_Measure_Tot = CALCULATE(SUM('Table'[PRIOR_PERIOD_COST]), 'Table'[_Type] = "R")




PBI_SuperUser_Rank@1x.png


Hope it resolves your issue? 
Did I answer your question? Mark my post as a solution!

Appreciate your Kudos, Press the thumbs up button!!
Linkedin Profile

@pranit828:
The PRIOR_PERIOD_COST is a measure, calculated using - 

 

Calculate_PRIOR_PERIOD_COST = 
VAR _selectedDates = VALUES(F_YEAR_MONTH_DATE_TYPE[CALENDARMONTH])
VAR _priorperiod = MINX(FIRSTNONBLANK(_selectedDates,1),[CALENDARMONTH])
VAR _prior_value = CALCULATE(SUM(F_DATE_M_P_COST[COST]),F_YEAR_MONTH_DATE_TYPE[CALENDARMONTH] = _priorperiod)

VAR _prior_R_value = CALCULATE(_prior_value, D_TYPES = "R")

Return _prior_R_value

 


I get the below error message,

spartanboy_0-1658169110336.png

 

Hi @spartanboy 

The error doesn't seem to be from the measure you have created. 

Does my DAX result in the correct sum when the value is = R as posted in the original issue requirement. You are adding new data points without giving a background context about it. Please create a new post if you have a different issue other than what you posted above.

 





PBI_SuperUser_Rank@1x.png


Hope it resolves your issue? 
Did I answer your question? Mark my post as a solution!

Appreciate your Kudos, Press the thumbs up button!!
Linkedin Profile

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.