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

Calculate each row with different value entered manually

Hello,

 

Is it possible in PowerBI to make same caluclation with manually entered values for each row in the table.

For example I made this table in excel:

 

1 ACCEPTED SOLUTION

Hi @Anonymous,

Did these slicers are designed with same datasource table fields? If this is a case, current power bi not able to extract different selection from the same datasource slicer. You need to duplicate tables with those fields use different table fields in slicers.

BTW, power bi not able to create dynamic calculate column/table based on filter/slicer, please use measure formal instead.

Reference link and sample formula:

What if Parameter for single row 

Measure =
MAX ( T1[Value] )
    * SWITCH (
        SELECTEDVALUE ( 'T1'[Key] ),
        1, SELECTEDVALUE ( S1[Value], SUM ( S1[Value] ) ),
        2, SELECTEDVALUE ( S2[Value], SUM ( S2[Value] ) ),
        3, SELECTEDVALUE ( S3[Value], SUM ( S3[Value] ) ),
        4, SELECTEDVALUE ( S4[Value], SUM ( S4[Value] ) ),
        5, SELECTEDVALUE ( S5[Value], SUM ( S5[Value] ) ),
        6, SELECTEDVALUE ( S6[Value], SUM ( S6[Value] ) ),
        BLANK ()
    )

Notice: S1~ S6 are tables with fields that use on slicer.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

8 REPLIES 8
v-shex-msft
Community Support
Community Support

Hi @Anonymous,

In power bi, you can't do edit on row contents as excel.
I'd like to suggest you add a measure, it can interact and calculate with current row contents and its results will be affected by filters. (you can use it to calculate in dax formula with current row and what if parameters)

Create and use what-if parameters to visualize variables in Power BI Desktop 

Regards,

Xiaoxin Sheng

 

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Anonymous
Not applicable

With What If parameter I can calculate all rows in the table with the same value. 

What I need is to calculate each row with different value.

 

I want to make a calculator in PowerBI where for each row the user will put different value, based on this value PowerBI should calculate just this row.

 

HI @Anonymous,

Any index fields existed in your table? If this is a case, you can write a calculated column with a variable table to stored index and correspond rate to use defined value to calculate with current row content:

DC =
VAR dict =
    DATATABLE (
        "id", INTEGER,
        "rate", DOUBLE,
        {
            { 1, 0.1 },
            { 2, 0.2 },
            { 3, 0.3 },
            { 4, 0.4 },
            { 5, 0.5 },
            { 6, 0.6 }
        }
    )
RETURN
    T1[value]
        * MAXX ( FILTER ( dict, [id] = T1[key] ), [rate] )

11.png

Regards,

Xiaoxin Sheng

 

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Anonymous
Not applicable

Hello @v-shex-msft  Any update after my explanation? Thanks!

Anonymous
Not applicable

I can put index, this is not a problem, but how to enter the values manually?

I want to be able to enter them for each indivisual row in slicer or something else and PowerBI to calculate based on this value.

Imagine that i have rows with products and i want in Report or Data view to be able to manupiolate the data baes on calues that i enter manually directly in the report - slicer or any other possible way

 

I made an example pbix with your data and calculated column and one example of what I really need.:

LINK TO PBIX (I used Microsoft Power BI Desktop (Optimized for Power BI Report Server - September 2019)

If you cannot open it here is print screen:

Screenshot_67.png

Hi @Anonymous,

Did these slicers are designed with same datasource table fields? If this is a case, current power bi not able to extract different selection from the same datasource slicer. You need to duplicate tables with those fields use different table fields in slicers.

BTW, power bi not able to create dynamic calculate column/table based on filter/slicer, please use measure formal instead.

Reference link and sample formula:

What if Parameter for single row 

Measure =
MAX ( T1[Value] )
    * SWITCH (
        SELECTEDVALUE ( 'T1'[Key] ),
        1, SELECTEDVALUE ( S1[Value], SUM ( S1[Value] ) ),
        2, SELECTEDVALUE ( S2[Value], SUM ( S2[Value] ) ),
        3, SELECTEDVALUE ( S3[Value], SUM ( S3[Value] ) ),
        4, SELECTEDVALUE ( S4[Value], SUM ( S4[Value] ) ),
        5, SELECTEDVALUE ( S5[Value], SUM ( S5[Value] ) ),
        6, SELECTEDVALUE ( S6[Value], SUM ( S6[Value] ) ),
        BLANK ()
    )

Notice: S1~ S6 are tables with fields that use on slicer.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Mariusz
Community Champion
Community Champion

Hi @Anonymous 

 

I think that you forgot to paste the table.

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

 

Anonymous
Not applicable

Sorry, here is the table:

ex.png

 

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.