cancel
Showing results for 
Search instead for 
Did you mean: 
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
Carousel_PBI_Wave1

2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Power BI Summit Carousel 2

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

Thank you 2022 Review

2022 Monthly Feature Releases

We had a great 2022 with a ton of feature releases to help you drive a data culture.