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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
MJALARI
Frequent Visitor

Need help to write DAX to calculate cumulative sum

Hi,

 

I have a requirement  seats table which includes columns as location and seats

 

LocationSeats 
Hyderabad1000
Chennai2000
Mumbai3000

 

and utilization table which includes columns as location and percentage utilization

Location

Utilization perc

Hyderabad0.75
chennai0.62
Mumbai0.79

 

 

I have common dimension of city which includes columns city

 

CITY

Hyderbad

Bangalore

Mumbai

 

Relationship between tables seat to city dimension and city to utilization  tables

 

Need to calculate irrespective of the city against (utilization perc) *( seats)  

 1000 * 0.75 = 750 

2000*0.62 = 1240

3000*0.79 = 2370

 

dax should return 750+1240 +2370 = 4360.

 

Note : i dont have city slicer.

 

Please help 

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi, @MJALARI 

I am not sure if I understood your question correctly, especially the part that you do not have a city slicer.

However, please check the below picture and the sample pbix file's link down below.

It is for creating a measure, not a column.

 

Picture2.png

 

Expected Result Measure =
SUMX ( Seats, Seats[Seats ] * RELATED ( Utilization[Utilization perc] ) )

 

 

https://www.dropbox.com/s/vjf2ucs7tjhzjac/mjalari.pbix?dl=0 

 

 

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.

 

Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM

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.


Go to My LinkedIn Page


View solution in original post

3 REPLIES 3
Jihwan_Kim
Super User
Super User

Hi, @MJALARI 

Thank you for your feedback.

Please check the below.

 

Picture1.png

 

Expected Result Measure =
SUMX (
Seats,
Seats[Seats ]
* LOOKUPVALUE (
Utilization[Utilization perc],
Utilization[Location], RELATED ( Cities[City] )
)
)

 

 

https://www.dropbox.com/s/vjf2ucs7tjhzjac/mjalari.pbix?dl=0 

 

 

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.

 

Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM

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.


Go to My LinkedIn Page


MJALARI
Frequent Visitor

Hi Jihwan ,

 

i dont have direct relationship between two tables , i have city dimension as intermediate. Apologies, missed to update

 

 

Jihwan_Kim
Super User
Super User

Hi, @MJALARI 

I am not sure if I understood your question correctly, especially the part that you do not have a city slicer.

However, please check the below picture and the sample pbix file's link down below.

It is for creating a measure, not a column.

 

Picture2.png

 

Expected Result Measure =
SUMX ( Seats, Seats[Seats ] * RELATED ( Utilization[Utilization perc] ) )

 

 

https://www.dropbox.com/s/vjf2ucs7tjhzjac/mjalari.pbix?dl=0 

 

 

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.

 

Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM

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.


Go to My LinkedIn Page


Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.

Top Solution Authors