cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ichebobo Member
Member

How to calculate the total of offpeak and peak period for a measure

 

Hi Forum,

 

I need help so as to create custom time and multiplication for my data.

 

7am -12 Midnight Peak: =  7 pence

12 Midnight – 7am : Off Peak = 3 pence

 

Please how do I get the calculation on my measure [PARK] to give me the accurate charge.

 

This is what I have done:

 

PORT = SUM ('REGION'[PARK]) * 5

 

For now, I  used the average ie 5 to make my multiplication but it is not correct.

 

Please Help

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: How to calculate the total of offpeak and peak period for a measure

Hi @ichebobo

I need to use some function in query editor, but I can't edit it in your pbix for I can't access to your data, you are using direct query mode, right?
Also, could you know what I do in my pbix, does it achieve your requirement?
 
Best Regards
Maggie
6 REPLIES 6
Community Support Team
Community Support Team

Re: How to calculate the total of offpeak and peak period for a measure

Hi @ichebobo

Could you show some data example and results you want?

Actually, I don't understand how the measure [PARK] calculate and look like and how should I create custom time and multiplication for your data?

 

Best Regards

Maggie

ichebobo Member
Member

Re: How to calculate the total of offpeak and peak period for a measure

Hi Maggie,

 

I've created a new table and its multiples. I  had to put it on a new page because I could not make it on same page as I am unable to write a conditional statement or DAX to make it show on same page .

 

 '[PARK]' needs to have an a peak and off peak charge

 

I've now sent the Pbix file to your email.

 

Please help

Community Support Team
Community Support Team

Re: How to calculate the total of offpeak and peak period for a measure

Hi @ichebobo

I still don’t know how to calculate the measure [PARK].

As assumed, I would supplement the condition, if I have misunderstood your requirement, please let me know.

7am -12 Midnight Peak: =  7 pence per hour

12 Midnight – 7am : Off Peak = 3 pence per hour

One’s cost time should be [DataTime]-[DataTimePrevious]

Since I can’t access your data model in Query editor where I need, so I make a simple example based on your dataset.

1.in query editor, create date only and time only column from the original date/time column.

2.in data model view, create calculated columns

4.png

 

Best Regards

Maggie

Community Support Team
Community Support Team

Re: How to calculate the total of offpeak and peak period for a measure

Hi @ichebobo

I need to use some function in query editor, but I can't edit it in your pbix for I can't access to your data, you are using direct query mode, right?
Also, could you know what I do in my pbix, does it achieve your requirement?
 
Best Regards
Maggie
ichebobo Member
Member

Re: How to calculate the total of offpeak and peak period for a measure

Hi Maggie,

 

The data is import. 

I've always sent this Pbix to the forum and they have always been accessed.

Please Is there anything I need to do differently so you can access the Pbix??.

I don't understand the workaround you suggested and what you did with your Pbix  thats why I wanted same to be replicated in the Pbix file I sent to your mail so as to give me a clear lead.

Please Help.

 

Best Regards,

Ichebobo

 

Community Support Team
Community Support Team

Re: How to calculate the total of offpeak and peak period for a measure

Hi @ichebobo

Actually, i don't know how to calculate the measure [PARK] since i don't know what's meaning it refers to and which columns should be used to calculate and what's result you need to get finally.

So in my previous reply, i give an example of which columns to use and how to use this columns to calculate the measure.

Thus i expect you to point if my understanding is correct.

For your pbix, i can get access to it, but can' t reach the data in query editor, it is a question for me because i need to apply some functions to data in query editor.

 

Best regards

maggie