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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.