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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Saniat
Helper V
Helper V

How to filter out zeros/nulls from MINX calculation

Hi,

I have the below calc, but I want to get the MIN only when it's more than zero, also want to avoid nulls:

MINX
(
        ALLSELECTED( '1'[Date] ), CALCULATE([Measure1])
         )

Can anyone help please ?
2 REPLIES 2
v-cgao-msft
Community Support
Community Support

Hi @Saniat ,

 

When the minimum value in the filtered date range is less than or equal to zero, then it will output blank, how do you want to output it?

please try:

Measure = 
VAR _value = MINX(FILTER(ALLSELECTED('1'[Date]),[Measure1]>0),[Measure1])
RETURN
 IF(ISBLANK(_value),"xxx",_value)

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

TomMartens
Super User
Super User

Hey @Saniat ,

 

w/o more details about the MEASURE and the data model I have difficulties answering your question.
Consider a pbix that contains sample data but still reflects your data model (tables, relationships, calculated columns, and measures). Upload the pbix to onedrive, google drive, or dropbox and share the link. If you are using Excel to create the sample data and as a source for the pbix, share the xlsx as well.
Explain the expected result based on the day you provide.

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.