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
Anonymous
Not applicable

If Condition Need help

Hi,

I've below DAX logic for my chart.  I've tried but no luck. Can someone help me on this one?

 

IF 

CALCULATE(count(CM[Change ID]),CM[Overdue / Not overdue]="Not Overdue")        is <1  
then 
CALCULATE(count(CM[Change ID]),CM[Overdue / Not overdue]="Not Overdue",CM[CMLastMonthYear]=1)
Else give "No Data Message"
1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

Please create a measure like this.

Measure = 
IF ( 
    CALCULATE(
        COUNT(CM[Change ID]), 
        FILTER(
            ALLSELECTED('CM'),
            CM[Overdue / Not overdue] = "Not Overdue"
        ) 
    ) < 1 , 
    CALCULATE(
        COUNT(CM[Change ID]), 
        FILTER(
            ALLSELECTED('CM'),
            CM[Overdue / Not overdue] = "Not Overdue" && CM[CMLastMonthYear] = 1
        )
    ) ,
    "No Data Message"
)

 

Best regards,
Lionel Chen

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

5 REPLIES 5
PhilipTreacy
Super User
Super User

Hi @Anonymous 

Try this

IF ( 
    
    CALCULATE(count(CM[Change ID]), SELECTEDVALUE(CM[Overdue / Not overdue]) = "Not Overdue") < 1 , 
    
    CALCULATE(count(CM[Change ID]), SELECTEDVALUE(CM[Overdue / Not overdue]) = "Not Overdue" && SELECTEDVALUE(CM[CMLastMonthYear]) = 1) ,
    
    "No Data Message"

    )

Without your data I can't be sure this si what you need.

Regards

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Anonymous
Not applicable

Hi,

SelectedValue function in Dax True/False not accepting. 

Any other methods to do this? altease with out "No Data message" is possible? 

Many thanks for your try 😊

 

MuraliPrasathS_0-1611929433058.png

 

Hi @Anonymous ,

 

Please create a measure like this.

Measure = 
IF ( 
    CALCULATE(
        COUNT(CM[Change ID]), 
        FILTER(
            ALLSELECTED('CM'),
            CM[Overdue / Not overdue] = "Not Overdue"
        ) 
    ) < 1 , 
    CALCULATE(
        COUNT(CM[Change ID]), 
        FILTER(
            ALLSELECTED('CM'),
            CM[Overdue / Not overdue] = "Not Overdue" && CM[CMLastMonthYear] = 1
        )
    ) ,
    "No Data Message"
)

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

PhilipTreacy
Super User
Super User

Hi @Anonymous 

If you provided your data and/or PBIX it woudl be easier to work on this.

Try this

IF ( 
    
    CALCULATE(count(CM[Change ID]), CM[Overdue / Not overdue] = "Not Overdue") < 1 , 
    
    CALCULATE(count(CM[Change ID]), CM[Overdue / Not overdue] = "Not Overdue" && CM[CMLastMonthYear] = 1) ,
    
    "No Data Message"

    )

Regards

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Anonymous
Not applicable

Hi Philip,

Thanks for your reply. I get below error msg.

MuraliPrasathS_0-1611925182233.png

 

For uploading pbix file/Data. I do not see any option to upload. Thanks!

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.