Forum Discussion
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
- AnonymousNot 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
RajThanks
Raj
- v-lili6-msftCommunity 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