cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Frequent Visitor

## Question regarding fixed value

Dear community,

I have the following simplified Table

 Company Project Period Value1 Value2 A A 13 10 20 A A 13 10 20 A B 13 20 A B 13 20 A C 13 10 20 A C 13 20 20 A D 13 20 A D 13 10

I want to create a measure that returns me a fixed value by dividing the sum of non blank value1 and the sum of non blank value2 whereas the sum of these values is grouped by Company and Period.

Here is what I have created to "achieve" the above desired result

``````AVERAGEX (
SUMMARIZE (
CALCULATETABLE (
'Table',
'Table'[Value1] <> BLANK ()
),
'Table'[Company],
'Table'[Period],
"Result",
VAR SumValue1=
SUM ( 'Table'[Value1] )
VAR SumValue2 =
SUM ( 'Table'[Value2] )
RETURN
SumValue1/ SumValue2
),
[Result]
)``````

And I get the following as a result if I use this measure, it seems that measure is calculating row by row

 Company Project Period Value1 Value2 Result A A 13 10 20 0,5 A A 13 10 20 0,5 A B 13 20 0 A B 13 20 0 A C 13 10 20 0,5 A C 13 20 20 1 A D 13 20 0 A D 13 10 0 Total 0,33333

Sum(Value1) = 50

Sum(Value2) = 150

Result = 50/150= 0,333333

Whereas I expected the fixed value based on the sum of non blank value1 and sum of non blank value2 should be applied

 Company Project Period Value1 Value2 Result A A 13 10 20 0,3333 A A 13 10 20 0,3333 A B 13 20 0,3333 A B 13 20 0,3333 A C 13 10 20 0,3333 A C 13 20 20 0,3333 A D 13 20 0,3333 A D 13 10 0,3333 Total 0,3333

Any help would be appreciated!

Kind regards,

Rookie12

1 ACCEPTED SOLUTION
Resolver II

@JustaRookie012, here is my suggested solution.

Change the DAX of your Result measure to this:

``````Result =
CALCULATE(
DIVIDE(SUM(YourTable[Value1]), SUM(YourTable[Value2])),
ALL(YourTable)
)``````

This gives me the following output:

Resolver II

@JustaRookie012, here is my suggested solution.

Change the DAX of your Result measure to this:

``````Result =
CALCULATE(
DIVIDE(SUM(YourTable[Value1]), SUM(YourTable[Value2])),
ALL(YourTable)
)``````

This gives me the following output:

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - June 2024

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

#### Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors
Top Kudoed Authors