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

measures as a value in matrix


Hi,

I'm facing an issue when i'm trying to pass a measure as a value in a matrix.

My data is in this format-

 
 

I have to show only B and E in my matrix and "X" which is the sum of D and E.

My desired output is-desired outputdesired output

I tried creating a measure X, which is the sum of measure D and E.

{

D=

var a = CALCULATE(

SUM('Table1'[Value]),

FILTER('Table1','Table1'[Account]="D"))

 

var b = CALCULATE(SUM('Table1'[Value]),

FILTER('Table1','Table1'[Year]=SELECTEDVALUE('Table1'[Year]) && 'Table1'[Account]="D"))

return

IF(SELECTEDVALUE('Table1'[Comparison])="CoC",a,IF(SELECTEDVALUE('Table1'[Comparison])="YoY",b))

E=

var a = CALCULATE(

SUM('Table1'[Value]),

FILTER('Table1','Table1'[Account]="E"))

 

var b = CALCULATE(SUM('Table1'[Value]),

FILTER('Table1','Table1'[Year]=SELECTEDVALUE('Table1'[Year]) && 'Table1'[Account]="E"))

return

IF(SELECTEDVALUE('Table1'[Comparison])="CoC",a,IF(SELECTEDVALUE('Table1'[Comparison])="YoY",b))

 

X=[D]+[E]

}

 

when i'm trying to pass this measure in Value section of the matrix, it's not showing anything

Matrix data setting:

Rows- Account

Columns- Quarter

Values- X

 

It's giving a blank matrix as an output. What is the alternative way to show this?

 

Please note- Data is huge and this is just the sample data to depict the data outline.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@v-yuta-msft  No, there's no conflict there. The measure is working fine and when i'm using the measure in the Values section in the matrix, it's not showing any value. There's no error. It's just that no values are being displayed.

View solution in original post

6 REPLIES 6
v-yuta-msft
Community Support
Community Support

@Anonymous ,

 

Please check if there's any conflict between the conditions in your measure:

'Table1'[Year]=SELECTEDVALUE('Table1'[Year])

'Table1'[Account]="D"

'Table1'[Account]="E"

'Table1'[Comparison])="CoC"

'Table1'[Comparison])="YoY"

Community Support Team _ Jimmy Tao

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

 

Anonymous
Not applicable

@v-yuta-msft  No, there's no conflict there. The measure is working fine and when i'm using the measure in the Values section in the matrix, it's not showing any value. There's no error. It's just that no values are being displayed.

@Anonymous 

 

Apologies upfront since this is stating the obvious...do you have either "CoC" or "YoY" selected as per your IF clauses in the RETURN expressions in both measrues D & E? If not I suspect that is why you are getting blanks





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






@Anonymous ,

 

Could you please share a simple sample table(need raw data, not the matrix visual) so that I could do further test?

 

Regards,

Jimmy Tao

PaulDBrown
Community Champion
Community Champion

@Anonymous 

 

Sorry, did you actually include a sample of your data structure? or is it in the structure as seen in you screenshot?





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Anonymous
Not applicable

@PaulDBrown  Yes, I have attached a sample data structure similar to the original one. I can't share the original one due to privacy policies.

 

The desired output which i want is-

 

A (which is directly coming from Data column Account)

(which is directly coming from Data column Account)

X (measure which shows the sum of D and E)

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.