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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric 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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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