This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreDid you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now
Hi, can someone please help to combine these two statements.
Firs Statement:
IF(ISBLANK([Date.Actual.Start]),BLANK(),}
IF(ISBLANK([Date.Actual.Completion]),BLANK(),
(DATEDIFF([Date.Actual.Start],[Date.Actual.Completion],DAY))))
2nd Statment:
IF( NOT( ISBLANK( [Date.Actual.Start] ) ),
IF(ISBLANK([Date.Actual.Completion]),
DATEDIFF([Date.Actual.Start], [If.Today],DAY)))
Solved! Go to Solution.
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 , Try like
IF(ISBLANK([Date.Actual.Start]),BLANK(),
IF(ISBLANK([Date.Actual.Completion]),DATEDIFF([Date.Actual.Start], [If.Today],DAY),
(DATEDIFF([Date.Actual.Start],[Date.Actual.Completion],DAY))))
Thank you, I tried this as well but can not get my desired out put.
I have multiple rows as below:
| Task | Actual Start | Actual Completion |
| A | 30-Sep-2021 | 30-Sep-2021 |
| B | 6-Oct-2021 | |
So when I select A, it shows me 1 day as added +1 in the above statement
When I select B, it shows me 7 days
But when none is selected, it doesnt calculate Actual - Today. It just calculate 1 form A. What I am trying to achieve DATEDIFF from 30 Sep to Today.
@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.
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
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 34 | |
| 31 | |
| 30 | |
| 21 | |
| 16 |
| User | Count |
|---|---|
| 62 | |
| 51 | |
| 31 | |
| 23 | |
| 23 |