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
Wresen
Post Patron
Post Patron

Get mesure value as a varible

Hi all.

I hope i have poested this in the right forum, this is a little jungel to me 🙂

 

I need little help , have tried to google the answer but have not found anything good,.

 

I have a calculated measure were i take 2 values that are linked to the same month and dived them.

Now i want to use that result from that calculation in the rest of the months (i want to have the resalut as a varible that i can use)

Now it is linked the the month that i use when i divided the 2 numbers and when i try to use the resualt i will only work on the same month that i used to get the diveded value.

 

I hope you understand what i mean.

 

/Thanks so much.

 

1 ACCEPTED SOLUTION

Hi @Wresen ,

 

To create two measures as below.

Value of one = 
VAR val =
    CALCULATE (
        SUM ( 'Table'[Value] ),
        FILTER ( ALL ( 'Table' ), 'Table'[Value] <> BLANK () )
    )
VAR amount =
    CALCULATE (
        SUM ( 'Table'[Count] ),
        FILTER ( ALL ( 'Table' ), 'Table'[Value] <> BLANK () )
    )
RETURN
    DIVIDE ( val, amount )
Measure = MAX('Table'[Amount])*[Value of one]

Capture.PNG

 

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

View solution in original post

6 REPLIES 6
kentyler
Solution Sage
Solution Sage

MyMeasure =

VAR firstDivisionResult = DIVIDE ( firstMonthValue, firstMonthValue2)

 

VAR secondMonthResult = DIVIDE( secondMonthValue, firstDivisionResult)

 

RETURN secondMonthResult





Did this post answer your question? Mark it as a solution so others can find it!

Help when you know. Ask when you don't!




Join the conversation at We Talk BI find out more about me at Slow BI


Thanks so much for a quick answer.

I am not sure but i do not get it to work, i think i may have beed bad explainign what i am looking to do,

 

I have diveded "Value" / "Count" and that gave me" Value of one"

"Mesure 3" is "Amount" * "Value of one"

I would like to be able to use Value of one (0,0,3448) to the rest of the rows in Measuer 3

 

If this would work 201906 , Measure 3 would say 5,2 (0,03448 * 151)

 

Power bi.JPG

Hi @Wresen ,

 

To create two measures as below.

Value of one = 
VAR val =
    CALCULATE (
        SUM ( 'Table'[Value] ),
        FILTER ( ALL ( 'Table' ), 'Table'[Value] <> BLANK () )
    )
VAR amount =
    CALCULATE (
        SUM ( 'Table'[Count] ),
        FILTER ( ALL ( 'Table' ), 'Table'[Value] <> BLANK () )
    )
RETURN
    DIVIDE ( val, amount )
Measure = MAX('Table'[Amount])*[Value of one]

Capture.PNG

 

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

Thanks so much , that worked perfectly.

 

Really appriciate the help. 🙂

 

Since you want to reference other values in the same row, perhaps this is a case for calculated columns. value_of_one.png

Once you have the "Value of One" column you can reference it in other columns

cal_column.png





Did this post answer your question? Mark it as a solution so others can find it!

Help when you know. Ask when you don't!




Join the conversation at We Talk BI find out more about me at Slow BI


Thanks again for all the help.

 

But i do not think that will work , 

 

"Amount" "Value" and "Count" are all calculated values from a table. (there is a few slicers options that give you these numbers)

I also have a slicer that makes you change "THIS MONTH" The slicer is on 201905  

 

/Thanks

 

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.