Forum Discussion
Help with DAX Measure - Sum with condition
- 9 months ago
Hi MVCPA ,
Sorry for the delay in response!!
Below is the updated measure which is showing normal time only for indirect for karen employee. Attached pbix file for reference.
Expected Value =SUMX(SUMMARIZECOLUMNS(employee[crc27_employee],'Time type'[crc27_timetype]),VAR CurrentHours =CALCULATE(SUM('Sample'[crc27_hours]))VAR HasData =NOT ISBLANK(CurrentHours)VAR NonNormalHours =CALCULATE(SUM('Sample'[crc27_hours]),REMOVEFILTERS('Time type'),NOT('Time type'[crc27_timetype] IN {"Normal Time"}))RETURNIF(HasData,IF(NonNormalHours >= 164.67,SWITCH(TRUE(),SELECTEDVALUE('Time type'[crc27_timetype]) = "Normal Time", 0,CurrentHours),SWITCH(TRUE(),SELECTEDVALUE('Time type'[crc27_timetype]) = "Normal Time",ABS(NonNormalHours - CurrentHours),CurrentHours)),BLANK()))Please review the output and let us know if you still need any further assistance here.
Thanks & Regards,
Rekha Athmakuri.
Hi Jihwan_Kim ,
Thank you for your response. I really appreciate it.!This is how my model looks like:
I have patented my work to your example. I am just not lucky to have the same results as yours. As you can see, my expected results multiplied the non-"Normal Time" by 2. I am not sure why.
Please see the results:
This is the measure that I used :
- Jihwan_Kim10 months agoSuper User
Hi,
If it is OK, please recreate a sample pbix file, and please share your sample pbix file's link.
And then, I can try to look into it.
Thank you.