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
Jeanxyz
Post Prodigy
Post Prodigy

need help with Dax measure

I got an error message with the measure below. 

 

Not sure why I got this error. The measure [overdue amount_EUR_Remeaure_All(M)] works, the column fact_invoice[Aging Group_billing] uses a formula below.

 

Aging Group_billing =switch(true(),
[overdue days]>0 &&[overdue days]<=30,"G1:0-30 days",
[overdue days]>30 &&[overdue days]<=60,"G2:31-60 days",
[overdue days]>60 &&[overdue days]<=90,"G3:61-90 days",
[overdue days]>90 &&[overdue days]<=120,"G4:91-120 days",
[overdue days]>120,"G4:>120 days")

 

dax measure.PNG

6 REPLIES 6
Jeanxyz
Post Prodigy
Post Prodigy

Unfortunately, the problem isn't solved.

Ashish_Mathur
Super User
Super User

Hi,

What is overdue days - a calculated column formula or a measure?   If it is a calculated column formula, then enture that the data type is numeric.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

the [overdue days] is a calculated formula, calculating the day difference. 

 

overdue days = if(and(Fact_Invoice[Due date]<today(),Fact_Invoice[Open Amount (Trans Curr.)]<>0),today()-Fact_Invoice[Due date],blank())
 
Aging Group_billing =switch(true(),
[overdue days]>0 &&[overdue days]<=30,"G1:0-30 days",
[overdue days]>30 &&[overdue days]<=60,"G2:31-60 days",
[overdue days]>60 &&[overdue days]<=90,"G3:61-90 days",
[overdue days]>90 &&[overdue days]<=120,"G4:91-120 days",
[overdue days]>120,"G4:>120 days")
 
[overdue_EUR_1_30 days_Remeasure]=
var amt=calculate([overdue amount_EUR_Remeaure_All(M)],filter(fact_invoice, fact_invoice[Aging Group_billing] in {"G1:0-30 days"})
 
As the [Aging Group_billing] column is referencing [overdue days] and works well, I don't understand why [overdue_EUR_1_30 days_Remeasure] fails. 

 

Good Morning,

 

Is your measure '[overdue amount_EUR_Remeaure_All(M)]' stored as type 'text'? 
 
In your return statement, you're setting the True value of the statement to =0, and DAX won't compare "0" = 0. 
 
If that's the case, setting it to a whole number should be enough to complete the formula. 
 
Hopefully that helps!

Hi,

There is probably some problem with the overdue amount_EUR_Remeaure_All(M) measure.  Also, your last measure can be simplified to

[overdue_EUR_1_30 days_Remeasure]=
Amt=calculate([overdue amount_EUR_Remeaure_All(M)],fact_invoice[Aging Group_billing]="G1:0-30 days")

Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi @Jeanxyz,

Did the above suggestions help with your scenario? if that is the case, you can consider Kudo or Accept the helpful suggestions to help others who faced similar requirements.

If these also don't help, please share more detailed information to help us clarify your scenario to test.

How to Get Your Question Answered Quickly 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.