Forum Discussion
hi
Hello,
I want something like this
| Start Date | End Date | Decreated date Upto (-) | Increase Date upto (+) | Count of days |
| 01/08/23 | 31/08/2023 | 31 | ||
| 01/08/23 | 31/08/2023 | 02/09/23 | 33 | |
| 01/08/23 | 31/08/2023 | 28/08/2023 | 28 |
Dates difference of
'Start Date' and 'End Date'
then add
'Increase Date upto' with 'Start Date' and 'End Date'
and subtract
'Decreated date Upto' with 'Increase Date upto' with 'Start Date' and 'End Date'
and want to actual count of days
please help me out
Thanks
Hi,
I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.
In this sample, I use DATEDIFF DAX function.
DATEDIFF function (DAX) - DAX | Microsoft Learn
It is for creating a new calculated column.
Count of days CC = SWITCH ( TRUE (), NOT ISBLANK ( Data[Decreated date Upto (-)] ), DATEDIFF ( Data[Start Date], Data[Decreated date Upto (-)], DAY ) + 1, NOT ISBLANK ( Data[Increase Date upto (+)] ), DATEDIFF ( Data[Start Date], Data[Increase Date upto (+)], DAY ) + 1, DATEDIFF ( Data[Start Date], Data[End Date], DAY ) + 1 )
6 Replies
- Jihwan_KimSuper User
Hi,
I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.
In this sample, I use DATEDIFF DAX function.
DATEDIFF function (DAX) - DAX | Microsoft Learn
It is for creating a new calculated column.
Count of days CC = SWITCH ( TRUE (), NOT ISBLANK ( Data[Decreated date Upto (-)] ), DATEDIFF ( Data[Start Date], Data[Decreated date Upto (-)], DAY ) + 1, NOT ISBLANK ( Data[Increase Date upto (+)] ), DATEDIFF ( Data[Start Date], Data[Increase Date upto (+)], DAY ) + 1, DATEDIFF ( Data[Start Date], Data[End Date], DAY ) + 1 )- abc_777Solution Specialist
Hello Jihwan_Kim ,
thanks for your help, i will check it
can you please help me to correct this measure please
VAR _sel = SELECTEDVALUE('KPI Comparisons'[KPI Comparisons Fields])
VAR _var =
SWITCH(
TRUE(),
CONTAINSSTRING(_sel, "KPI Total Vs Last Month Sale"),
IF([KPI Total Vs Last Month Sale] > 0, "Light Green", "Red"),
// Add more conditions if needed
CONTAINSSTRING(_sel, "KPI Total Vs Last Year Sale"),
IF([KPI Total Vs Last Year Sale] > 0, "Light Green", "Red"),
// Add more conditions as necessary
"Default Color"
)- abc_777Solution Specialist
please help me to correct this one.