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

Total from distinct values

HI, i need some advise:

 

I have this query: district, region, target

 

query1query1

Then apply a slicer and choose: Distric=north, and region=1, give me target 10,13.

 

 

filter valuesfilter values.

 

i want a measure give a total = 23 if a change my slice this total change too.

 

 

 

3 ACCEPTED SOLUTIONS
Phil_Seamark
Employee
Employee

Hi @sixtoquiles

 

Try creating a measure over Target to be something like this

 

Sum of Target = CALCULATE(SUM('Table'[target]'))

From the data and description you have provided, this will result in a value of 23 once the filters on district and region have been set.


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

View solution in original post

kaushikd
Resolver II
Resolver II

Well its simple you just have to create a measure and power bi will do the rest of it.

Please follow the steps

1. On the Dataset Right click and choose New Measure.

2. TotalTarget=SUM(<DatasetName>[Target])

Now this measure will be the total sum of the target value now all you have to do is just drag and drop it into the table

the table will group District and Region and show the TotalTarget with respect to it.

3. Drag and drop a table

4. In Field Choose District, Region and TotalTarget

5. Drop a Slicer and in field choose District, Region

View solution in original post

Hi Phil_Seamark

i believe SUM('Table'[target]) will be sufficient.

is there any need of CALCULATE ???

View solution in original post

4 REPLIES 4
kaushikd
Resolver II
Resolver II

Well its simple you just have to create a measure and power bi will do the rest of it.

Please follow the steps

1. On the Dataset Right click and choose New Measure.

2. TotalTarget=SUM(<DatasetName>[Target])

Now this measure will be the total sum of the target value now all you have to do is just drag and drop it into the table

the table will group District and Region and show the TotalTarget with respect to it.

3. Drag and drop a table

4. In Field Choose District, Region and TotalTarget

5. Drop a Slicer and in field choose District, Region

Phil_Seamark
Employee
Employee

Hi @sixtoquiles

 

Try creating a measure over Target to be something like this

 

Sum of Target = CALCULATE(SUM('Table'[target]'))

From the data and description you have provided, this will result in a value of 23 once the filters on district and region have been set.


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Hi Phil_Seamark

i believe SUM('Table'[target]) will be sufficient.

is there any need of CALCULATE ???

Hi @kaushikd,

 

You don't need the CALCULATE but it is a good habit to get into for when your DAX becomes more sophisticated.


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

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.