Forum Discussion
phjz
3 years agoFrequent Visitor
Counting Days in a column
Hey all, its really hard to explain, so I'll try to show you what I want within the following table. What I want is a formula for the column "Number of Days". As the table doesn't has values ...
- 3 years ago
Hi, phjz
You can't apply a measure to the x-axis of line chart.
You need to convert your original measure formula to calculated column formula.
Column_Number of days = VAR basedate = CALCULATE ( MIN ( Table1[Date] ), ALLEXCEPT ( Table1, Table1[Product] ) ) RETURN DATEDIFF ( basedate, Table1[Date], DAY ) + 1Best Regards,
Community Support Team _ Eason
Anonymous
3 years agoNot applicable
hello phjz ,
please try :
Number of days =
VAR basedate = CALCULATE(MIN(Table1[Date]),ALLEXCEPT(Table1,Table1[Product]))
return
DATEDIFF(basedate,SELECTEDVALUE(Table1[Date]),DAY) +1
ā
phjz
3 years agoFrequent Visitor
That does work really good - thank you so much!
There is one last problem with this: I want to compare Product A and B using a line diagram, but I can't put the measure on the x-axis. When I try to type the formula in the field for a new column, it doesn't work. Do you have an idea for this?
- v-easonf-msft3 years ago
Community Support
Hi, phjz
You can't apply a measure to the x-axis of line chart.
You need to convert your original measure formula to calculated column formula.
Column_Number of days = VAR basedate = CALCULATE ( MIN ( Table1[Date] ), ALLEXCEPT ( Table1, Table1[Product] ) ) RETURN DATEDIFF ( basedate, Table1[Date], DAY ) + 1Best Regards,
Community Support Team _ Eason