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
T2WAII
Regular Visitor

Calculate with conditions and MIN

Hi there,

 

I am searching for a solution for the following use-case:

 

I have a table that has to be filtered before I want to select the related value of the MIN-Value out of Column XY. 

It should be clear with this example:

T2WAII_0-1668726663711.png

 

First of all, I only want to consider only 'Cats', no 'Dogs'. 

After that, I want to choose the row with the lowest 'AnimalNumber' for each day, to get a list with 'Date' + 'Value' for the selected row. 

These information should be visualized in the chart. 

Unfortunately, I was not able to create a Measure-Statement, that delivers the desired result. In my dataset I have a Calendar-Table, that is related to my Fact-Table. The Dates are shown on the x-axis like in my example. 

 

= CALCULATE (
    VALUES ( FactAnimals[Value]),
    FILTER ( ALL ( FactAnimals[AnimalNumber] ), FactAnimals[AnimalNumber] = MIN( ( FactAnimals[AnimalNumber] ) ) )
)

 

 

This is my code sample, but ofc it does not care about 'Cat' or 'Dog'. How can I add the condition, that I will only receive 'Cat'-Values?

 

Thank you very much! 

 

1 ACCEPTED SOLUTION

Hi,

Thank you for your reply.

In the meantime, I was able to find a solution for my problem. I processed my data in the DWH in another way, so the DAX-solution was not necessary anymore. 

Thank you for your help, next time I will upload a Sample-Dataset directly! 

Have a nice day, best regards

 

T2WAII

View solution in original post

2 REPLIES 2
v-jayw-msft
Community Support
Community Support

Hi @T2WAII ,

 

Please share some sample data so that we could test the formula.

 

Best Regards,

Jay

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

Hi,

Thank you for your reply.

In the meantime, I was able to find a solution for my problem. I processed my data in the DWH in another way, so the DAX-solution was not necessary anymore. 

Thank you for your help, next time I will upload a Sample-Dataset directly! 

Have a nice day, best regards

 

T2WAII

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.