Don't miss your chance to take exam DP-600 or DP-700 on us!
Request nowLearn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
My expression:
Solved! Go to Solution.
I Think you need MEASURES, not COLUMNS.
I have tried to replicate your scenario using data1 and data2 as dates, calculate 2 differente DATEDIFF and then a "FINAL" measure with an IF. Not super-elegant but it seems to be working
www.autodafe.net/tmp/EXAMPLE.pbix
1st I Calculate (Measure) End of Selected Month:
EOM = EOMONTH(SELECTEDVALUE(Cal[Date]);0)
DDIFF1 =DATEDIFF(SELECTEDVALUE(Foglio1[data1]);[EOM];DAY) DDIFF2 = DATEDIFF(SELECTEDVALUE(Foglio1[data1]);SELECTEDVALUE(Foglio1[data2]);DAY)
Final = IF(ISBLANK([DDIFF2]); [DDIFF1];[DDIFF2])
so the question is???
your formula looks correct. Are you creating a new COLUMN or new MEASURE ??
Hi @autodafe ,
It's a column.
Here's the result:
.
as you can see it does not calculate until the end of the selected month (Date_Demande) - FP#00057
Can you help?
I Think you need MEASURES, not COLUMNS.
I have tried to replicate your scenario using data1 and data2 as dates, calculate 2 differente DATEDIFF and then a "FINAL" measure with an IF. Not super-elegant but it seems to be working
www.autodafe.net/tmp/EXAMPLE.pbix
1st I Calculate (Measure) End of Selected Month:
EOM = EOMONTH(SELECTEDVALUE(Cal[Date]);0)
DDIFF1 =DATEDIFF(SELECTEDVALUE(Foglio1[data1]);[EOM];DAY) DDIFF2 = DATEDIFF(SELECTEDVALUE(Foglio1[data1]);SELECTEDVALUE(Foglio1[data2]);DAY)
Final = IF(ISBLANK([DDIFF2]); [DDIFF1];[DDIFF2])
Here's what I got for a specific date (18/08/2018)
Worked very well. Thanks .
Can you help me exclude weekends and holidays now ?
Thanks .
try to create a separate Date dimension, add one ro more attribute (true/false) for holidays and weekends, somethin like
Date Weekend Holiday 01/05/2019 False True 02/05/2019 False False 03/05/2019 False False 04/05/2019 True False 05/05/2019 True False
the Weekend column could be calculated using the WEEKDAY function (if weekday is Sat or Sun then TRUE)
https://docs.microsoft.com/en-us/dax/weekday-function-dax
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 55 | |
| 48 | |
| 38 | |
| 16 | |
| 15 |
| User | Count |
|---|---|
| 83 | |
| 71 | |
| 38 | |
| 28 | |
| 25 |