Forum Discussion
Combining IF Statements
- Anonymous4 years ago
Hi mohammadyousaf ,
I created a sample pbix file(see attachment), please check whether that is what you want. You can create a measure as below to get the Days.Calculations:
Days.Calculations = VAR _tab = ADDCOLUMNS ( 'Table', "@datediff", IF ( ISBLANK ( [Actual Start] ), BLANK (), DATEDIFF ( [Actual Start], IF ( ISBLANK ( [Actual Completion] ), TODAY () ), DAY ) + 1 ) ) RETURN IF ( ISFILTERED ( 'Table'[Task] ), SUMX ( _tab, [@datediff] ), MINX ( FILTER ( _tab, NOT ( ISBLANK ( [Actual Completion] ) ) ), [@datediff] ) )Best Regards
mohammadyousaf , selected value, means you are looking for a measure? or for a column
Can you share sample data and sample output in table format?
Measure.. I have chart with values A & B
so when I select A
When I select B
here when A or B not selected
it shows 1, and i want it to be MIN of Actal Start - Today() because B is still in progress and it should calculate unless there is a completion date.
- Anonymous4 years agoNot applicable
Hi mohammadyousaf ,
I created a sample pbix file(see attachment), please check whether that is what you want. You can create a measure as below to get the Days.Calculations:
Days.Calculations = VAR _tab = ADDCOLUMNS ( 'Table', "@datediff", IF ( ISBLANK ( [Actual Start] ), BLANK (), DATEDIFF ( [Actual Start], IF ( ISBLANK ( [Actual Completion] ), TODAY () ), DAY ) + 1 ) ) RETURN IF ( ISFILTERED ( 'Table'[Task] ), SUMX ( _tab, [@datediff] ), MINX ( FILTER ( _tab, NOT ( ISBLANK ( [Actual Completion] ) ) ), [@datediff] ) )Best Regards