Forum Discussion
Dynamic Quarter Selection
- 6 years ago
It was using LASTDATE('Asset type'[As_of_date]) In the Current Quarter downloads that was giving you the problem but we also didn't need the filter statement.
Current Quarter = VAR _current = FORMAT ( TODAY() ,"yyyy-\Qq" ) RETURN CALCULATE( SUM ( 'Asset type'[Downloads] ), 'Asset type'[Fiscal_quarter] = _current )Last Quarter = var _last = FORMAT ( EOMONTH( TODAY(), -3 ),"yyyy-\Qq") RETURN CALCULATE( SUM ( 'Asset type'[Downloads] ), 'Asset type'[Fiscal_quarter] = _last )For your second question a couple of notes.
First you should always write a measure rather than just pulling a value into a visual so for downloads we have.
Total Downloads = SUM ( 'Asset type'[Downloads] )This lets us use that in further measures, prior week for example:
PW Downloads = CALCULATE ( [Total Downloads] , DATEADD ( 'Asset type'[As_of_date] , -7 , DAY ) )Then we can put them together for a week over week change
WoW downloads = [Total Downloads] - [PW Downloads]And again for the % change
WoW % Change = DIVIDE ( [WoW downloads], [PW Downloads] )My updated file is attached for you to take a look at.
If this solves your issues please mark it as the solution. Kudos 👍 are nice too.
HI jdbuchanan71 ,
I have uploaded the file to my google drive. here's the link: https://drive.google.com/openid=1HA30k083pI1bcWIMsczM2Z6gKAB1OXEG
Hope this works!
Best,
Akash
It was using LASTDATE('Asset type'[As_of_date]) In the Current Quarter downloads that was giving you the problem but we also didn't need the filter statement.
Current Quarter =
VAR _current = FORMAT ( TODAY() ,"yyyy-\Qq" )
RETURN
CALCULATE( SUM ( 'Asset type'[Downloads] ), 'Asset type'[Fiscal_quarter] = _current )Last Quarter =
var _last = FORMAT ( EOMONTH( TODAY(), -3 ),"yyyy-\Qq")
RETURN
CALCULATE( SUM ( 'Asset type'[Downloads] ), 'Asset type'[Fiscal_quarter] = _last )
For your second question a couple of notes.
First you should always write a measure rather than just pulling a value into a visual so for downloads we have.
Total Downloads = SUM ( 'Asset type'[Downloads] )
This lets us use that in further measures, prior week for example:
PW Downloads = CALCULATE ( [Total Downloads] , DATEADD ( 'Asset type'[As_of_date] , -7 , DAY ) )
Then we can put them together for a week over week change
WoW downloads = [Total Downloads] - [PW Downloads]
And again for the % change
WoW % Change = DIVIDE ( [WoW downloads], [PW Downloads] )
My updated file is attached for you to take a look at.
If this solves your issues please mark it as the solution. Kudos 👍 are nice too.
- Anonymous6 years agoNot applicable
This was great!! Thanks a ton!!
Best,
Akash.