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

Calculation

Hi Team,

 

I have some data shown below.

 

MonthFolio startsFolio endsProductCodeDisposalWorking capacityTank ratio
Feb2022020120220229XT-0012,275,0003,288,1030.69
March2022030120220332XT-0013,974,0003,288,1031.21
April2022040120220431XT-0012,868,0003,288,1030.87
May2022050120220532XT-0012,339,0003,288,1030.71
        
Feb2022020120220229YT-0022,152,0002,681,1410.8
March2022030120220332YT-0021,600,0002,681,1410.6
April2022040120220431YT-0021,636,0002,681,1410.61
May2022050120220532YT-0021,578,0002,681,1410.59
        
Feb2022020120220229ZT-0031,555,0002,674,7020.58
March2022030120220332ZT-0032,972,0002,674,7021.11
April2022040120220431ZT-0033,982,0002,674,7021.49
May2022050120220532ZT-0032,265,0002,674,7020.85
        
Feb2022020120220229WT-0041,930,0003,898,7860.5
March2022030120220332WT-0042,496,0003,898,7860.64
April2022040120220431WT-0042,076,0003,898,7860.53
May2022050120220532WT-0043,604,0003,898,7860.92

 

I need output like this.

 

Feb    7,912,00012,542,7320.63
March    11,042,00012,542,7320.88
April    10,562,00012,542,7320.84
May    9,786,00012,542,7320.78

 

so the disposal is sum of all the months.When comes to work capacity it is not summing correctly.While taking this ratio in the bar graph it is adding all the values because the work capacity is same.If I am trying to write the measure it is adding all the values.

 

It is working fine on the Matrix table visual.When comes to Bargraph it is not showing correctly.

 

Could anyone please help me on this.

 

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

Hi  @Anonymous ,

I created a sample pbix file(see attachment) for you, please check whether that is what you want. You can create a measure as below:

Ratio = 
VAR _selmonth =
    SELECTEDVALUE ( 'Table'[Month] )
VAR _disposal =
    CALCULATE ( SUM ( 'Table'[Disposal] ), ALLSELECTED ( 'Table'[Month] ) )
VAR _wc =
    CALCULATE ( SUM ( 'Table'[Working capacity] ), ALLSELECTED ( 'Table'[Month] ) )
RETURN
    DIVIDE ( _disposal, _wc )

yingyinr_0-1656996657834.png

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

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

View solution in original post

2 REPLIES 2
v-yiruan-msft
Community Support
Community Support

Hi  @Anonymous ,

I created a sample pbix file(see attachment) for you, please check whether that is what you want. You can create a measure as below:

Ratio = 
VAR _selmonth =
    SELECTEDVALUE ( 'Table'[Month] )
VAR _disposal =
    CALCULATE ( SUM ( 'Table'[Disposal] ), ALLSELECTED ( 'Table'[Month] ) )
VAR _wc =
    CALCULATE ( SUM ( 'Table'[Working capacity] ), ALLSELECTED ( 'Table'[Month] ) )
RETURN
    DIVIDE ( _disposal, _wc )

yingyinr_0-1656996657834.png

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Nathaniel_C
Super User
Super User

Hi @Anonymous 

Please provide your pbix.


If you would share your pbix, or dummy up some values in Excel both for current and expected data. Please copy and paste them into your post, rather than doing a picture, we may be able to help you. 

Please read this post to get your question answered more quickly:

https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

Nathaniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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.