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
Hering_W
Regular Visitor

value and group measure in a single plot (with slicer-selection of the group)

Hello everybody,

 

i need to create a plot with two measurs:
1. amount of product over time
2. amout of group (of the product) over time


I have a table "orders" with the following columns:
1. date

2. group
3. product
4. amout

I have two slicer:

1. date-slicer
2. product-slicer to coose a single product

 

I tried to work with ALLEXCEPT and SELECTEDVALUE, but it didn't work.

CALCULATE(sum(orders[amount]);FILTER(ALLEXCEPT(orders;orders[date]);orders[group]=SELECTEDVALUE(orders[group])))

 

When I select e.g. the product A for the timeperiod January 18 to March 2018, than I need to see a line für the amount of A and another for the group of 1.

 

 

Example.JPG

 

Here the table "orders":

dategroupproductamount
Jan-181A100
Feb-181A200
Mar-181A150
Apr-181A100
Jan-181B250
Feb-181B100
Mar-181B100
Apr-181B100
Jan-181C50
Feb-181C20
Mar-181C50
Apr-181C80
Jan-182D100
Feb-182D200
Mar-182D300
Apr-182D400
Jan-182E200
Feb-182E100
Mar-182E200

 

Any ideas?

 

Kind regards.

 

1 ACCEPTED SOLUTION
v-jiascu-msft
Employee
Employee

Hi @Hering_W,

 

Try these two measures, please. You need to clear the context of Product in the second measure.

 

productAmount = sum(Table1[amount])
groupAmount =
VAR selectedGroup =
    IF (
        ISBLANK ( SELECTEDVALUE ( Table1[group] ) ),
        1,
        SELECTEDVALUE ( Table1[group] )
    )
RETURN
    CALCULATE (
        SUM ( Table1[amount] ),
        FILTER (
            ALL ( 'Table1'[group], Table1[product] ),
            Table1[group] = selectedGroup
        )
    )

value-and-group-measure-in-a-single-plot-with-slicer-selection-of-the-group

 

Best Regards,

Community Support Team _ Dale
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

1 REPLY 1
v-jiascu-msft
Employee
Employee

Hi @Hering_W,

 

Try these two measures, please. You need to clear the context of Product in the second measure.

 

productAmount = sum(Table1[amount])
groupAmount =
VAR selectedGroup =
    IF (
        ISBLANK ( SELECTEDVALUE ( Table1[group] ) ),
        1,
        SELECTEDVALUE ( Table1[group] )
    )
RETURN
    CALCULATE (
        SUM ( Table1[amount] ),
        FILTER (
            ALL ( 'Table1'[group], Table1[product] ),
            Table1[group] = selectedGroup
        )
    )

value-and-group-measure-in-a-single-plot-with-slicer-selection-of-the-group

 

Best Regards,

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

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.