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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

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

Hi @Anonymous

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

View solution in original post

6 REPLIES 6
v-juanli-msft
Community Support
Community Support

Hi @Anonymous

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

v-juanli-msft
Community Support
Community Support

Hi @Anonymous

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

Anonymous
Not applicable

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

Hi @Anonymous

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
Anonymous
Not applicable

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

 

Hi @Anonymous

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

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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