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

Incorrect Measure Total

Hello All,

I am working on a project to calculating users' time value by choosing different transporation method. For example, I had a raw data like below.

Capture - Time Value 1.JPG

It include Trip, Passenger, numbers of time they go on this trip, time of different transporation and time difference compare taxi to other transportation(Train - Taxi or Subway - Taxi). 

And then I will have a slicer to allow user to choose their production rate and use that to times the time difference and frq. (Time value = frq* Production Rate* diff vs. XX)

I am trying to do it in power bi and each row shows fine but "measure total" keep gives me a wrong num. The below table is the ideal result I am trying to get.

Capture - Time Value 2.JPG 

 

I hope to have two slicers on selecting production rate and passenger and only showing top 2 frquent trip this passenger took in the past. In the end, I hope to get the sum time value of how many time value this passenger can save by selecting Taxi.

 

I have been stuck in this problem for a week. Please let me know if anyone has an idea. Thanks!

1 ACCEPTED SOLUTION
v-frfei-msft
Community Support
Community Support

Hi @Anonymous,

 

Based on my test, we can take the following steps to meet your requirements.

 

1.Enter the data as you shared and create the measures to get the time values per way. Then we can get correct total and filter the table visual based on the rank.

 

Time value sub = SUM(Table1[Frq])*SELECTEDVALUE('Production Rate'[Production Rate])*SUM(Table1[Diff vs.subway])

 

Time value sub2 = SUMX(Table1,[Time value sub])
Time value train = SUM(Table1[Frq])*SELECTEDVALUE('Production Rate'[Production Rate])*SUM(Table1[Diff vs.Train])
Time value train2 = SUMX(Table1,[Time value train])
frqs = SUM(Table1[Frq])
rank = IF(ISBLANK([frqs]),BLANK(),RANKX(ALLSELECTED(Table1),[frqs],,DESC,Dense))

 

2.To get the total time that could be saved by selecting taxi. We can create the measure as below.

 

save time sub = SUM(Table1[Diff vs.subway])*SUM(Table1[Frq])
save time s = SUMX(Table1,[save time sub])
save time train = SUM(Table1[Diff vs.Train])*SUM(Table1[Frq])
save time t = SUMX(Table1,[save time train])

 

Here is the result for your reference.

 

1.png

 

For more details, please check the pbix as attached.

 

https://www.dropbox.com/s/r81zv1xngb8qgo9/Incorrect%20Measure%20Total.pbix?dl=0

 

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

2 REPLIES 2
v-frfei-msft
Community Support
Community Support

Hi @Anonymous,

 

Based on my test, we can take the following steps to meet your requirements.

 

1.Enter the data as you shared and create the measures to get the time values per way. Then we can get correct total and filter the table visual based on the rank.

 

Time value sub = SUM(Table1[Frq])*SELECTEDVALUE('Production Rate'[Production Rate])*SUM(Table1[Diff vs.subway])

 

Time value sub2 = SUMX(Table1,[Time value sub])
Time value train = SUM(Table1[Frq])*SELECTEDVALUE('Production Rate'[Production Rate])*SUM(Table1[Diff vs.Train])
Time value train2 = SUMX(Table1,[Time value train])
frqs = SUM(Table1[Frq])
rank = IF(ISBLANK([frqs]),BLANK(),RANKX(ALLSELECTED(Table1),[frqs],,DESC,Dense))

 

2.To get the total time that could be saved by selecting taxi. We can create the measure as below.

 

save time sub = SUM(Table1[Diff vs.subway])*SUM(Table1[Frq])
save time s = SUMX(Table1,[save time sub])
save time train = SUM(Table1[Diff vs.Train])*SUM(Table1[Frq])
save time t = SUMX(Table1,[save time train])

 

Here is the result for your reference.

 

1.png

 

For more details, please check the pbix as attached.

 

https://www.dropbox.com/s/r81zv1xngb8qgo9/Incorrect%20Measure%20Total.pbix?dl=0

 

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
Anonymous
Not applicable

Thank you so much, Frank!

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.