Latest Enterprise DNA Initiatives

Calculate Filter problem

I am trying to filter my data by Opportunity ID and then type Cat and Dog, my formula is is not providing any data.


Amount Cat & Dog =
VALUES(Data[Opportunity Id]),
[Type]=“CAT” &&

This is the result I am trying to get

In addition ( I haven’t got to this yet), I would also like all types associated with Cat

Any guidance would be greatly appreciated…I think I am closeDNA test CalculateFilter.pbix (30.8 KB)

Hi @KimC, we aim to consistently improve the topics being posted on the forum to help you in getting a strong solution faster. While waiting for a response, here are some tips so you can get the most out of the forum and other Enterprise DNA resources.

  • Use the forum search to discover if your query has been asked before by another member.

  • When posting a topic with formula make sure that it is correctly formatted to preformated text </>.

  • Use the proper category that best describes your topic

  • Provide as much context to a question as possible.

  • Include demo pbix file, images of the entire scenario you are dealing with, screenshot of the data model, details of how you want to visualize a result, and any other supporting links and details.

I also suggest that you check the forum guideline How To Use The Enterprise DNA Support Forum. Not adhering to it may sometimes cause delay in getting an answer.


You were much closer than you even realized. Your simple amount measure was all that was needed. All I did was modified your data model slightly to add an Opportunities Dimension table, which I used for the rows of the matrix. Then just put Type in the column well, and [Amount] in the Values well of the matrix visual, and context does the rest for you - the complex measure you created was not necessary.



I hope this is helpful. Full solution file attached below.

Hi Brian,

On the result I would like worksheet, I had filtered the opportunity id to show the result I wanted. If I remove that filter, and change the type to CAT and DOG it doesn’t work. Same result as before:




Ack! My bad - totally missed the filter pane conditions. Let me rework this and get back to you.

Sorry for the oversight.

  • Brian


I created different measures for every Type to get the type of matrix table you are looking to achieve. The measures will come into play when you are trying to filter the Type. For e.g. if looking to just get all the amount associated with Cat & Dog, you just have to drag the Cat & Dog measure in filter pane and set the filtering to is not blank as follows:

There might be better solution than this but I get to make it work with this method. Attaching the pbix file and let us know if it satisfies your requirement.

eDNA Forum - DNA test CalculateFilter Solution.pbix (43.1 KB)


1 Like


Apologies for the earlier confusion. I think I’ve now got a full solution for you that makes no use of the filter pane. The key is the DAX expression below that creates a table of only the Opportunity IDs for which there is at least one type cat and one type dog.

Cat and Dog =
        Opportunities[Opportunity Id]
    "@TotCat", [TotalCat],
    "@TotDog", [TotalDog],
    "@Amount", [Amount]
VAR FiltvTable = FILTER(
    [@TotCat] >= 1 &&
    [@TotDog] >= 1
    "@ID", Opportunities[Opportunity Id]
    FILTER( ALL( Data ), Data[Opportunity Id] IN DistID )


I hope this is helpful. Full solution file below.

1 Like

Thank you both, @BrianJ & @MudassirAli I really appreciate the time you have taken out of your day to find a solution to my problem. This example is a simplified version of my model and I think the solution from @MudassirAli will suit my needs the best and it is simple for my brain to understand and replicate :grinning:
You are the Dax king @BrianJ, that is some impressive code your wrote!
:pray: :pray: :pray: :pray: :pray: :pray: :pray:


Happy to help, and glad you got what you needed. I find it endlessly fascinating to see the different routes that people take to reach the same desired results. NIce work, @MudassirAli.

  • Brian
1 Like