Forum Discussion
Anonymous
3 years agoNot applicable
Days calculation from slicer
Hi, I want to calculate days from the selected month, it shold be 61 days. How I get this result. I am not using date or calander table, slicer dates come from fact table. I tried following: days...
- 3 years ago
Anonymous Try:
days = var MINval = MIN('Fact'[Date]) var Maxval = Max('Fact'[Date]) var result = ( MaxVal - MINval ) * 1. return result
Greg_Deckler
3 years agoCommunity Champion
Anonymous Try:
days =
var MINval = MIN('Fact'[Date])
var Maxval = Max('Fact'[Date])
var result = ( MaxVal - MINval ) * 1.
return
resultAnonymous
3 years agoNot applicable
Thanks Greg, but it gives days count from begining of fact date till end date.
Its not giving days between selected months.
- Greg_Deckler3 years agoCommunity Champion
Anonymous Difficult to say unless maybe your slicer is not filtering whatever visualization you are displaying the measure in. Or, are you creating this as a calculated column? If a calculated column, that won't work as those are not interactive. You have to create it as a measure. I mocked up a PBIX file that demonstrates. It is attached below signature.
- Anonymous3 years agoNot applicable
Hi Greg,
I checked the data and fact date started from 5th May, the min day counts from there so no full counts of day in May. It shows 26 instead of 31 but its because of data stored in fact.