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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
joeywong
Helper I
Helper I

Get the value of a specific row

Hi all,

 

I need help here. I have a table with subtotals by month. I need to divide a specific row with the subtotal.

 

For denomitor, i used this formula A(D)=calculate([A],DATESMTD(Dates[MonthEnding]))

For numerator, may I know how to get the value of the specific row? 

 

joeywong_0-1671371762346.png

 

Thanks!

 

Best Regards,

Joey

 

6 REPLIES 6
v-yalanwu-msft
Community Support
Community Support

Hi, @joeywong ;

In the image above, I don't see the 'Date' [MonthYear] column, you can try to put it in. Or try changing the formula:

 

D =
DIVIDE (
    SUM ( 'Table'[Column] ),
    CALCULATE (
        SUM ( 'Table'[Column] ),
        FILTER ( ALLSELECTED ( 'Date' ), 'Date'[MonthYear] = MAX ( 'Date'[MonthYear] ) )
    )
)

 

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.

Solved: How to upload PBI in Community - Microsoft Power BI Community


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

sevenhills
Super User
Super User

In addition to @v-yalanwu-msft answer,

For your understanding, typically, you will use sum / max / min /  count to get values of a selected row. 

 

 

-- Select the type of the current row
var _selT = SELECTEDVALUE(Table2[Type])

-- To get the same row amount value, you can use sum amount as below:
var _v = CALCULATE(sum(Table2[Amount]), filter(Table2, Table2[Type] = _selT))

 

 

Check similar requirement I answered

https://community.powerbi.com/t5/Desktop/Cost-by-Category-Measure-to-divide-1-Category-by-Another-in...

Ashish_Mathur
Super User
Super User

Hi,

Your question is not clear.  Is the image that you have shared a Table visual that you have already created?  Share the download link of your PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-yalanwu-msft
Community Support
Community Support

Hi, @joeywong ;

If you wan get the value of specific row, you could try Sum([colum]) in measure. as follow:

Measure = DIVIDE(SUM('Table'[Value]),CALCULATE(SUM([Value]),ALLEXCEPT('Table','Table'[Month])))

The final show:

vyalanwumsft_0-1671418872896.png


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

Hi Yalan,

 

Thank you for your suggestions. However, when I incorporate the formula, the % total does not come up to 100%.

 

joeywong_0-1671441723551.png

Is there anything wrong with the following formulas?

D = Divide(

        sum('Table'[Column]),

        Calculate(Sum('Table'[Column]),

        ALLEXCEPT('Date','Date'[MonthYear])))

 

Thanks!

 

 

Hi Yalan,

 

Thank you for your suggestions. However, when I incorporate the formula, the % total does not come up to 100%.

 

joeywong_0-1671441723551.png

Is there anything wrong with the following formulas?

D = Divide(

        sum('Table'[Column]),

        Calculate(Sum('Table'[Column]),

        ALLEXCEPT('Date','Date'[MonthYear])))

 

Thanks!

 

 

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors