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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Anonymous
Not applicable

Compare measures to category

Hello!
I have a problem,
I use a stacked area chart on a date-axis with a few categoty-filters like this:

einarrattgard_1-1628511443903.png

I want to add a measure on top. 
How do I do that? The only place i can add a measure on is in tooltips:

einarrattgard_2-1628511494825.png

 

1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

There is another way, I don’t know if you accept it.

 

First create a separate table:

 

Category = 
UNION(
    DISTINCT('Table'[KPI - Category]), 
    {"1S or lower"}
)

vkkfmsft_0-1628757659731.png

 

Then use the following measure:

 

Measure = 
IF(
    MAX(Category[KPI - Category])= "1S or lower",
    [1S or lower],
    CALCULATE(
        SUM('Table'[Value]),
        FILTER( 'Table', 'Table'[KPI - Category] = MAX(Category[KPI - Category]) )
    )
)

vkkfmsft_1-1628757757045.png

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

Best Regards,
Winniz

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

View solution in original post

5 REPLIES 5
selimovd
Super User
Super User

Hey @Anonymous ,

 

why can't you add it to the values field?

 
Best regards
Denis
 
Anonymous
Not applicable


@selimovd 
That is my question. When I try to add a measure, it just replaces the column.
Could it be because of the legend somehow?

Hi @Anonymous ,

 

You are right. If you add a lengend, then you can only add a field in the Values pane. I think you need to replace the legend with measures, like this: 

 

image.png

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

Best Regards,
Winniz

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

 

Anonymous
Not applicable

Thank you. It would solve the issue but its very clunky.

Hi @Anonymous ,

 

There is another way, I don’t know if you accept it.

 

First create a separate table:

 

Category = 
UNION(
    DISTINCT('Table'[KPI - Category]), 
    {"1S or lower"}
)

vkkfmsft_0-1628757659731.png

 

Then use the following measure:

 

Measure = 
IF(
    MAX(Category[KPI - Category])= "1S or lower",
    [1S or lower],
    CALCULATE(
        SUM('Table'[Value]),
        FILTER( 'Table', 'Table'[KPI - Category] = MAX(Category[KPI - Category]) )
    )
)

vkkfmsft_1-1628757757045.png

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

Best Regards,
Winniz

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

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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