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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
revansh
Helper IV
Helper IV

Calculate SUM of dax measure

Hi,

 

I have my data like:

 

state hours  days

NY    100      1

NY     140      2

NJ     100      1

NJ      200     2

NJ     300      3

 

 

dax:   HOURS_PER_DAY= SUM(HOURS)/ MAX(DAYS)

 

RESULT TABLE IN POWERBI:

 

STATE    HOURS_PER_DAY

NY             120

NJ              200

TOTAL       280

 

MY REQUIREMENT:

 

STATE    HOURS_PER_DAY

NY             120

NJ              200

TOTAL       320

 

 

i WANT TO SHOW total as sum(hours_per_day) .

 

Thanks

 

 

 

1 ACCEPTED SOLUTION
TomMartens
Super User
Super User

Hey,

 

this measure

Measure = 
SUMX(VALUES('Table1'[State]),
	CALCULATE(SUM(Table1[Hours])
		,ALLEXCEPT('Table1',Table1[State])
	)
	/CALCULATE(MAX(Table1[Days])
		,ALLEXCEPT('Table1',Table1[State])
	)
)

creates what you are looking for

2017-08-28_22-23-19.png

 

Hope this is what you're looking for

 

Regards



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

1 REPLY 1
TomMartens
Super User
Super User

Hey,

 

this measure

Measure = 
SUMX(VALUES('Table1'[State]),
	CALCULATE(SUM(Table1[Hours])
		,ALLEXCEPT('Table1',Table1[State])
	)
	/CALCULATE(MAX(Table1[Days])
		,ALLEXCEPT('Table1',Table1[State])
	)
)

creates what you are looking for

2017-08-28_22-23-19.png

 

Hope this is what you're looking for

 

Regards



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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