cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
pelucapampa Regular Visitor
Regular Visitor

Same Period Last Year

Hi !!

I've a Page with Relative Date filter.

Into one graphic I've Hotel Occupancy Measure (I've paste Measure Code)

 

OcupacionMensual = 
var pHO = CALCULATE(SUM(EstadGeneral[HO]), 'Date'[Date])
var pHA = CALCULATE(sum(EstadGeneral[HA]), 'Date'[Date])
var pRR = DIVIDE(pHO, pHA) * 100
VAR result = INT(ROUND(pRR,0))
return result

 Into Other Measure, I've the same calculation, but Same Period Last Year.

 

OcupacionMensualSPLY = 
var pHO = CALCULATE(SUM(EstadGeneral[HO]), DATEADD('Date'[Date],-1,1,YEAR))
var pHA = CALCULATE(sum(EstadGeneral[HA]), DATEADD('Date'[Date],-1,1,YEAR))
var pRR = DIVIDE(pHO, pHA) * 100
VAR result = INT(ROUND(pRR,0))
return result

My problem is when I put two measures into the same graphic, I can't see into the same graph, because the graph are filter with Relative date.

 

It's possible to solve that and see into the same graph both measures?

1 REPLY 1
Community Support Team
Community Support Team

Re: Same Period Last Year

@pelucapampa,

 

Instead of relative date filter, you may add filter arguments in CALCULATE as well.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

New Badges

Incoming: New and Improved Badges

Exciting news: We've given our badges an overhaul and added brand news ones.

Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 301 members 2,865 guests
Please welcome our newest community members: