Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Same Day Last Year measure not appearing in chart

Hello,

 

So my data is kwh consumption per day for various buildings in a perio of 2 years. What i need to visualise is kwh consumption compared to the same weekday last year (the closest one for the same month).

So i have used DAX measures to get those. For Kwh same day last year i used:

 

Kwh LY to Day=CALCULATE([Total Kwh], FILTER(ALL('Date'),'Date'[DWY]=MAX('Date'[DWY])-1))

 
 And for the variation i used:
 
 LY to Day Kwh Var = 'Electricity Consumption 19/20'[Total Kwh]-[Kwh LY to Day]. I also did the % with: 
LY to Day Kwh % Var = DIVIDE([LY to Day Kwh Var], [Kwh LY to Day])
 
So i got all the corecct numbers and used them in a table, slicing it by year.
When i try to move those to a line chart though i either can't get them to show or i get the wrong numbers (kwh last year to day is the same as kwh this year)
 
Can anyone help??
Thanks 🙂
4 REPLIES 4
amitchandak
Super User
Super User

Same weekday is 364 days behind

Same week day Year behind Sales = CALCULATE([Total Kwh],dateadd('Date'[Date],-364,DAY))
Year behind Sales = CALCULATE([Total Kwh],dateadd('Date'[Date],-1,Year))
Anonymous
Not applicable

@amitchandak thanks for the measure now it works better in the sense that both 

Same week day Year behind Sales

and kwh appear in the chart. But the line value for same weekday last year is in the beginning of the chart that has the older dates and the columns are at the end with this year's dates.

 

What i need is for the columns to show this year dates and the line value to show same weekday last year. When i try to filter by date then the line with the last year to date measure diasapears completely.

 

Any idea on how to get the visual i need with the measure you gave me, this year kwh and the date in a line chart?

Hi @Anonymous ,

Can you please share some sample data and a few screenshots? Then we will understand clearly.

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

2020-04-02 11_00_47-Electricity March 2020 - Power BI Desktop.png

@v-xuding-msft 

 

I have this chart with Kwh for 2020 and 2019. I have a measure that shows Kwh same day last year (the orange one) and a value that shows kwh this year (the blue columns). I want to show them together in my visual so the report can show the difference between this year and same weekday last year. For some reason thought they are shown separetely and i don't know how to connect them.

Unfortunately i can't share any of the data i have, hope the screenshot helps.

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.