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
JasonNahal
New Member

SUM a column with multiple filters from another column of the same table

Hi DAX Gurus and fellow Noobs,

 

 I am looking for help with the following Table:

ReferenceNameAmount
GST-40
Call out fee100
reimbursement400
GST-200
Call out fee60
GST20
Call out fee100
Meals50

 

I want to get the SUM(Table[Amount]) where Table[ReferenceName] = "GST" AND "Call out fee". What DAX formula could achieve this?

 

The above table is an extract from a SQL db and has 1000s of rows and 100s of different values in the ReferenceName column.

 

Any help will be much appriciated. thank you!

2 ACCEPTED SOLUTIONS
MFelix
Super User
Super User

Hi @JasonNahal,

Depending on the way you setup your visialization you don't even need a measure to calculate this.

You can place the values in a visual and then filter the visu by the reference column. Other option is to use the reference column on the legend's of the charts that will give you a column line or bar for each of the references.

If you really want to use a measure you need to use something similar to this:

Gst = CALCULATE(SUM( TABLE[AMOUNT]) ; TABLE[REFERENCENCENAME] = "Gst")

Hope this helps.

Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

v-yiruan-msft
Community Support
Community Support

Hi @JasonNahal ,

You can directly use some default visuals in Power BI Desktop and add some visual-level filters to achieve this function (for example: table visual)

In addition , if you want to create calculated column/ measure through DAX , you can use the below similar formula to create it .

 default.JPG

If the above methods are not applicable in your scenario, please provide the related table structure and more sample data(exclude sensitive data).

create measure.JPG

Best Regards

Rena

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.

View solution in original post

4 REPLIES 4
v-yiruan-msft
Community Support
Community Support

Hi @JasonNahal ,

You can directly use some default visuals in Power BI Desktop and add some visual-level filters to achieve this function (for example: table visual)

In addition , if you want to create calculated column/ measure through DAX , you can use the below similar formula to create it .

 default.JPG

If the above methods are not applicable in your scenario, please provide the related table structure and more sample data(exclude sensitive data).

create measure.JPG

Best Regards

Rena

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.

Thank you @v-yiruan-msft. Filters did the trick. 

MFelix
Super User
Super User

Hi @JasonNahal,

Depending on the way you setup your visialization you don't even need a measure to calculate this.

You can place the values in a visual and then filter the visu by the reference column. Other option is to use the reference column on the legend's of the charts that will give you a column line or bar for each of the references.

If you really want to use a measure you need to use something similar to this:

Gst = CALCULATE(SUM( TABLE[AMOUNT]) ; TABLE[REFERENCENCENAME] = "Gst")

Hope this helps.

Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



thank you for responding @MFelix. using Filters for the visualization did the trick.

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.