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

Sum calculation help

Hi All,

 

I am stuck with a measure calculation , scenario is as below - 

 

 bus details.PNG 

 

So basically I need to calculate the sum of Hrs considering only the records highlighted in Bold i.e. Take an example of Q2 , include the records that have their end passage in the same quarter but started in previous quarter and exclude the records which start in the same quarter but dont end in the same quarter. So based on the quarter and year what user selects the sum needs to be calculated for the stoppages that end in the same quarter.

4 REPLIES 4
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @Anonymous,

 

I'm still a little confused about your logic.

 

Based on your information, do you want to calculate the sum of the Hrs which has been highlight in yellow?

 

If it is convenient, could you share your data sample as table format and your desired output so that I can have a test and get the solution.

 

Best Regards,

Cherry

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

@v-piga-msft 

 

 

YearQuarterBus NameStop PointDateHrs
2018Q1AmberStart Passage15/03/18123
2018Q1Ambera16/03/1812
2018Q1AmberEnd passage20/03/1814
2018Q1AmberHalt25/03/1832
2018Q1AmberStart Passage27/03/1823
2018Q1Ambere28/03/1856
2018Q2Amberf02/04/1867
2018Q2Amberg03/04/1889
2018Q2AmberEnd passage04/04/181
2018Q2AmberHalt05/04/1814
2018Q2AmberStart Passage06/06/1825
2018Q2Ambera22/06/1834
2018Q2AmberEnd passage24/06/1831
2018Q2AmberStart Passage27/06/1876
2018Q2Ambera28/06/1885
2018Q3Amberb14/07/1864
2018Q3Amberc18/07/1854
2018Q3Amberd22/07/1851
2018Q3Ambere27/07/1835

 

Basically the requirement is to calculate the total hrs the records which needs to be included in the calculation is with below condition. Let us assume that user selects quarter 2 as a slicer. Now the while calcuating the sum for quarter 2 , measure should include the records as follows - 

Include - the hours wherein bus might have been started in previous quarter but have the end passage in the current quarter i.e. If you see the above table 1st two records highlighted in orange are part of Q1 but as the bus end passage is in Q2 , these values should be part of Q3 hrs

 

Accordingly - consider the entry dated 27/06/2018 onwards wherein the bus has started in Q2 , but it should be excluded from the calculation of Hrs for Quarter for that particular Bus.

 

So if you go through the above statements and compare it with the values that i have highlighted you would be able to link them together.

 

Thanks once again for the kind help

Anonymous
Not applicable

In my previous reply i had by mistake written Q3 to corrected to Q2

 

@v-piga-msft 

 

 

YearQuarterBus NameStop PointDateHrs
2018Q1AmberStart Passage15/03/18123
2018Q1Ambera16/03/1812
2018Q1AmberEnd passage20/03/1814
2018Q1AmberHalt25/03/1832
2018Q1AmberStart Passage27/03/1823
2018Q1Ambere28/03/1856
2018Q2Amberf02/04/1867
2018Q2Amberg03/04/1889
2018Q2AmberEnd passage04/04/181
2018Q2AmberHalt05/04/1814
2018Q2AmberStart Passage06/06/1825
2018Q2Ambera22/06/1834
2018Q2AmberEnd passage24/06/1831
2018Q2AmberStart Passage27/06/1876
2018Q2Ambera28/06/1885
2018Q3Amberb14/07/1864
2018Q3Amberc18/07/1854
2018Q3Amberd22/07/1851
2018Q3Ambere27/07/1835

 

Basically the requirement is to calculate the total hrs the records which needs to be included in the calculation is with below condition. Let us assume that user selects quarter 2 as a slicer. Now the while calcuating the sum for quarter 2 , measure should include the records as follows - 

Include - the hours wherein bus might have been started in previous quarter but have the end passage in the current quarter i.e. If you see the above table 1st two records highlighted in orange are part of Q1 but as the bus end passage is in Q2 , these values should be part of Q2 hrs

 

Accordingly - consider the entry dated 27/06/2018 onwards wherein the bus has started in Q2 , but it should be excluded from the calculation of Hrs for Quarter for that particular Bus.

 

So if you go through the above statements and compare it with the values that i have highlighted you would be able to link them together.

 

Thanks once again for the kind help

Anonymous
Not applicable

@v-piga-msft -  were you able to find some solution for the below mentioned issue

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.