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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
kk_shp_user
Helper I
Helper I

Measure based on a column B value which is equal to Column A Slicer Value

I have two tables as shown below with a relationship on id column.

 

In Table_1, each id might have the same internal and external title (or)  a different internal title to that of the extrernal title.

Lets assume A,B,C,D,E as the titles; So, an id 010 might have an internal title = 'A' and external title = 'E'

 

kk_shp_user_0-1713959105569.png

 

I am trying to get a measure that will give the SUM(sales) from Table_2 for ids based on external title while I have a slicer with internal title.

 

Example, I have a slicer for internal title. When I choose the internal title 'A', I want the measure to display the SUM(sales) for ids that have an external title 'A'.

 

I tried the below measure but it does not seem to work,

 

 CALCULATE(SUM('Table_2'[sales]), TREATAS(VALUES('Table_1'[internal title]), 'Table_1'[external title]))
1 ACCEPTED SOLUTION
Martin_D
Super User
Super User

Hi @kk_shp_user ,

 

You need to also remove the filter from the internal title column, otherwise this still applies and your result includes only ids with internal title = A and external title = A.

 CALCULATE(SUM('Table_2'[sales]), TREATAS(VALUES('Table_1'[internal title]), 'Table_1'[external title]),REMOVEFILTERS('Table_1'[internal title])))

 

Kind regards,

Martin

View solution in original post

4 REPLIES 4
Martin_D
Super User
Super User

Hi @kk_shp_user ,

 

You need to also remove the filter from the internal title column, otherwise this still applies and your result includes only ids with internal title = A and external title = A.

 CALCULATE(SUM('Table_2'[sales]), TREATAS(VALUES('Table_1'[internal title]), 'Table_1'[external title]),REMOVEFILTERS('Table_1'[internal title])))

 

Kind regards,

Martin

Thanks I'll try this and report back.

 

Another query - if I use this measure inside another measure, will it still work?

Hi @kk_shp_user ,

Yes inside of another measure it will still work, e.g., like this:

 

Some other measure = [Above measure] + [addition measure]

 

Kind regards,

Martin

@Martin_D  Thanks for your contribution on this thread.

Hi @kk_shp_user ,

What's your final expected result? Could you please provide some sample data (exclude sensitive data) with Text format and your expected result with backend logic and special examples? It would be helpful to find out the solution. You can refer the following link to share the required info:

How to provide sample data in the Power BI Forum


Another query - if I use this measure inside another measure, will it still work?


Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.