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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
cottrera
Post Prodigy
Post Prodigy

DAX SUM query

Hi Community 
I have the following model in desktop

cottrera_0-1698846889040.png
Here is an example of the facts table. 

cottrera_1-1698846996437.png

 

My Stock dimension table connects to the fact table using the UPRN field.   The Stock dimension table has a field called 'Tenants affected' here is an example

cottrera_2-1698847149679.png

 Ony my report page I would like to display in a card visual the number of 'tenants affected'  however due to the fact table containing mutiple 'UPRN's the DAX function I am try to write SUMS all 'Tenants' for each of the mutiple UPRNs

 

As shown in the example below my DAX is outputting 11

UPRNTenants Affected
181
181
263
263
263

 

Where as I need it to output 4

UPRNTenants Affected
181
  
263


Thank you

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @cottrera ,

Thanks for your feedback. If you still want to get it, you can create antoher new measure as below and replace the original measure [Members Affected] on the visual.

Measure = SUMX ( VALUES ( 'DIM_Stock'[UPRN] ), [Members Affected] )

vyiruanmsft_0-1699241210842.png

Best Regards

View solution in original post

5 REPLIES 5
cottrera
Post Prodigy
Post Prodigy

Hi v-yiruan-msft & sjoerdvn by company has now decided they no longer need the insight that I was working on . Therefore the measure I required is no required. Thank you for your help

Anonymous
Not applicable

Hi  @cottrera ,

Thanks for your feedback. If you still want to get it, you can create antoher new measure as below and replace the original measure [Members Affected] on the visual.

Measure = SUMX ( VALUES ( 'DIM_Stock'[UPRN] ), [Members Affected] )

vyiruanmsft_0-1699241210842.png

Best Regards

sjoerdvn
Super User
Super User

I think you want to use a measure like this (note that you'll have to adapt to the proper table and column names, as these are not entirely clear from your information):

# tenants affected =CALCULATE(SUM(Stock[Members Affected]), CROSSFILTER(Stock[UPRN],RepairsFact[UPRN], Both))
cottrera
Post Prodigy
Post Prodigy

Hi thank you for responding so quickly.

 

Members and Tenants affected are the same (appologies) The members figures is a measure that points at  DIM_Stock table 

Members Affected = SUM(Stock[Members Affected])
 
The UPRN is from theDIM_Stock table 

cottrera_0-1699003754913.png

 

thank you

Anonymous
Not applicable

Hi @cottrera ,

Thanks for reaching out to us about your problem. Base on my research, it seems that you want to get the count of 'tenant effected' and display it on the card visual. In order to make further troubleshooting and give you a solution shortly, could you please provide the following info? It would be very helpful to find the solution. Thank you.

  • Are the field [Members Affected] and 'tenant effected' the same?
  • Is the field[Members Affected] a measure or fact field in the table 'Stock'? If it is a measure, could you please provide the related formula?

        vyiruanmsft_1-1699002689784.png

  • What's the formula of [Tenants Affected]?
  • How did you set the following output? Is the field [UPRN] from stock dimension table or facts table?
    UPRN Tenants Affected
    18 1
    18 1
    26 3
    26 3
    26 3

Best Regards

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.