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.
Hi,
Could someone please help, I can't figure out what is the issue with my DAX.
I have a "Työaika" table and I'm trying to make calculated column "FTE" but it gives random results. With two statements it works fine both, using switch or if but adding the third condition it gets messed up. for example here is a picture from table and wrong results
My DAX statement:
Hi @Anonymous ,
Your formula involves multiple AND()/OR() conditions. In order to ensure the correctness of the formula, can you describe the logic?
Also, please show the expected result (what is the correct result where you marked) so that we can understand your logic.
Best Regards,
Jay
https://drive.google.com/drive/folders/1ezZPjDyCdk7tzaSF6xkXue_DqnWIMEwY?usp=sharing
here is my pbix file, if it helps
Hi @Anonymous ,
Please try this:-
OsaAika FTE =
SWITCH (
TRUE (),
(
'Työsopimus'[Työsuhteen muoto] = "Ei määritetty"
&& 'Työsopimus'[startdate] <= TODAY ()
)
|| ( 'Työsopimus'[enddate] >= TODAY () )
|| ( BLANK () ), 0,
(
'Työsopimus'[Työsuhteen muoto] = "Kokoaikainen"
&& 'Työsopimus'[startdate] <= TODAY ()
)
|| ( 'Työsopimus'[enddate] >= TODAY () )
|| ( BLANK () ), 1,
(
'Työsopimus'[Työsuhteen muoto] = "Osa-aikainen"
&& 'Työsopimus'[startdate] <= TODAY ()
)
|| ( 'Työsopimus'[enddate] >= TODAY () )
|| ( BLANK () ),
CALCULATE (
SUMX ( 'Työsopimus', 'Työsopimus'[weeklyworktimemaxminutes] ) / 2 / 37.5
)
)
Best Regards,
Samarth
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
Hi @Samarth_18 and thank you for your reply. This didn't help. It gives the same result. To mention, I have tried this to other column too and the end result is the same.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
108 | |
105 | |
88 | |
74 | |
66 |
User | Count |
---|---|
126 | |
111 | |
100 | |
83 | |
71 |