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-Funktion DAX

Hey,

I coul need some Help, I'm trying to creat this IF-Funktion 

=IF(Ziele1[KPI<Aktuell2[Wert];DIVIDE(Sum(Ziele1[KPI]);Sum(Aktuell2[Wert]));DIVIDE(SUM(Aktuell2[Wert]);Sum(Ziele1[KPI])))  

in DAX.

 

But it's not workoing and I can't finde my Mistake.   So I hoppe, that you can help me.  

 

Thank You Jonas

2 REPLIES 2
v-lili6-msft
Community Support
Community Support

hi, @Anonymous

Just for your formula

=IF(Ziele1[KPI]<Aktuell2[Wert];DIVIDE(Sum(Ziele1[KPI]);Sum(Aktuell2[Wert]));DIVIDE(SUM(Aktuell2[Wert]);Sum(Ziele1[KPI])))

There is a "]" missing from your formula.

Do to you want to create a column or a measure?

I find that Ziele1[KPI] and Aktuell2[Wert] are in different table, what is your expected output?

If you want to add a measure you could use this formula like below:

Measure = IF (
    SELECTEDVALUE ( Ziele1[KPI] ) < SELECTEDVALUE ( Aktuell2[Wert] ),
    DIVIDE ( SUM ( Ziele1[KPI] ), SUM ( Aktuell2[Wert] ) ),
    DIVIDE ( SUM ( Aktuell2[Wert] ), SUM ( Ziele1[KPI] ) )
)

If it is not your case, please share a simple sample pbix file or some data sample and expected output. You can upload it to OneDrive and post the link here. Do mask sensitive data before uploading.

 

 

 

Best Regards,

Lin

 

 

 

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

HI @Anonymous

  The syntax you have used is not DAX compliant. Please refer https://docs.microsoft.com/en-us/dax/if-function-dax for the DAX syntax.

 

The below code should work for you.

 

=IF(Ziele1[KPI]<Aktuell2[Wert],

             DIVIDE(Sum(Ziele1[KPI]),Sum(Aktuell2[Wert]),

             DIVIDE(SUM(Aktuell2[Wert]),Sum(Ziele1[KPI])

      )

 

 

Thanks
Raj

 

Thanks

Raj

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.