Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

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.

 

  • Anonymous's avatar
    Anonymous
    4 years ago

    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 )

    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

2 Replies

Replies have been turned off for this discussion
  • Anonymous's avatar
    Anonymous
    Not applicable

    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 )

    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