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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
icdns
Post Patron
Post Patron

Computation per Unit

Hi Guys, 

 

Would need your help in computing the per unit computation. I have year my monthly table. The computation of PER UNIT is Data Point per Month / Maximum Data Point. Ex. 456/999 to get 0.46. 

 

I tried Max function but it doesnt get the max value for the month. Could somebody help me? 

 

icdns_0-1647398869459.png

 

Thank you! 

 

 

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

Hi @icdns ,

Please refer to my pbix file to see fi it helps you.

Create a measure or column.

 

 

Measure =
VAR max_value =
    CALCULATE (
        MAX ( sampledata[Sales] ),
        ALLEXCEPT ( sampledata, sampledata[Year] )
    )
RETURN
    DIVIDE ( MAX ( sampledata[Sales] ), max_value )

 

 

The column.

 

 

Column =
VAR max_value =
    MAX ( sampledata[Sales] )
RETURN
    DIVIDE ( sampledata[Sales], max_value )

 

 

vpollymsft_1-1647581416488.png

If I have misunderstood your meaning, please provide your desired output with more details.

 

 

Best Regards

Community Support Team _ Polly

 

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

6 REPLIES 6
v-rongtiep-msft
Community Support
Community Support

Hi @icdns ,

Please refer to my pbix file to see fi it helps you.

Create a measure or column.

 

 

Measure =
VAR max_value =
    CALCULATE (
        MAX ( sampledata[Sales] ),
        ALLEXCEPT ( sampledata, sampledata[Year] )
    )
RETURN
    DIVIDE ( MAX ( sampledata[Sales] ), max_value )

 

 

The column.

 

 

Column =
VAR max_value =
    MAX ( sampledata[Sales] )
RETURN
    DIVIDE ( sampledata[Sales], max_value )

 

 

vpollymsft_1-1647581416488.png

If I have misunderstood your meaning, please provide your desired output with more details.

 

 

Best Regards

Community Support Team _ Polly

 

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

 

icdns
Post Patron
Post Patron

Hi @VahidDM ,

 

You can access this sample pbix here. https://www.mediafire.com/file/0pbtogvc6kib02k/sample_powerbi.pbix/file

 

Thank you very much for your help!

VahidDM
Super User
Super User

HI @icdns 

 

You need to calculate the MAX when you removed the filter to consider all rows' values.

Try this to find 999:

 

MAX Value = calculate(MAX(Table[Count]),all(table))

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

Hi @VahidDM ,

 

My report has filters like YEAR etc, how can go about it? Like it will be dynamic depending on your filters..

It will compute the PER UNIT. 

 

Thanks alot!! 

@icdns 

 

In that case, you need to use removefter Dax formula or you can define a variable and find the max with my previous formula and use allexcept(table,table[year]).

 

can you share a sample of your data or your PBIX file.

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

Hi @VahidDM ,

 

You can access this sample pbix here. https://www.mediafire.com/file/0pbtogvc6kib02k/sample_powerbi.pbix/file

 

Thank you very much for your help!

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.