Forum Discussion
Anonymous
3 years agoNot applicable
calculate datediff column date using filters
hello, I need help using DAX. Her is my problem: I have a table of operation and their date for multiple scenarios with column date and I want to do a datediff on this column using filters: Ex...
- Anonymous3 years ago
I've found the solution , I created a table with :
Table =VAR xxxx =SUMMARIZECOLUMNS('dwh BU'[LB_BU],'dwh OPERATION_SIMULATION'[CD_OPERATION],"datediff_XX", DATEDIFF ( CALCULATE ( FIRSTDATE( 'dwh OPERATION_SIMULATION'[DT_XX] ), 'dwh TYPE_SCENARIO'[LB_TYPE_SCENARIO] = "Premier validé" ),CALCULATE ( FIRSTDATE( 'dwh OPERATION_SIMULATION'[DT_XX] ), 'dwh TYPE_SCENARIO'[LB_TYPE_SCENARIO] = "Référence" ), DAY ) ,"datediff_YY", DATEDIFF ( CALCULATE ( FIRSTDATE( 'dwh OPERATION_SIMULATION'[DT_YY] ), 'dwh TYPE_SCENARIO'[LB_TYPE_SCENARIO] = "Premier validé" ),CALCULATE ( FIRSTDATE( 'dwh OPERATION_SIMULATION'[DT_YY] ), 'dwh TYPE_SCENARIO'[LB_TYPE_SCENARIO] = "Référence" ), DAY ))return xxxx
Idrissshatila
Super User
3 years agoHello,
You could add a column where you use this calclation column = Datediff( DATE_XX, DATE_YY, DAY )
So you'll have a column based with the how much days for each row, then you can visualise it by ID operation and can see how many days per each operation.
If I answered your question, please mark my post as solution, Appreciate your Kudos👍
- Anonymous3 years agoNot applicable
Thank you for your reply.
I don't want to calculate Datediff( DATE_XX, DATE_YY, DAY ) but using the same date column :
Datediff( DATE_XX (where ID_TYPE_SCENARIO =1 ), DATE_XX (ID_TYPE_SCENARIO =2), DAY )