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
PepitoTratado
Frequent Visitor

Measure based on filters slicers

Hi guys,

I have this model in the center products table, in the left side, prices lists ( I have many lists and each product may have different prices according to the list) and in the right side, the parents from these products .

model.PNG

I'm trying to do a measure to know the total amount on each product depending on price list ( from inliprix)  and on qty ( from struc_act)

I have this pivot table with the following measure in pivot column and two slicer to filter prices lists and parents

Measure = CALCULATE(AVERAGE(inliprix[price_list])*AVERAGE(Struc_act[qty]))

tbl.PNG

 

At the end a want to show in a field Qty x Price according to price list number (6 and 8 in the exemple) and subtotal by prod parent

 

I'm not sure about average I used in my measure but I don't know what to do

 

Thanks in advance

 

Pep.

 

1 ACCEPTED SOLUTION
v-lid-msft
Community Support
Community Support

Hi @PepitoTratado ,

 

As the sample you shared, I think that you want to correct the total, you can change your measure to following:

 

Test =
VAR t =
    FILTER (
        inliprix,
        inliprix[list_number] = SELECTEDVALUE ( inliprix[list_number] )
    )
RETURN
    SUMX (
        t,
        [price_list]
            * AVERAGEX ( FILTER ( 'Struc_act', Struc_act[Code-prod] = [Code-prod] ), [qty] )
    )

Measure-based-on-filters-slicers-1.png

 

BTW, pbix as attached.

 

Best regards,

 

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

Community Support Team _ Dong Li
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-lid-msft
Community Support
Community Support

Hi @PepitoTratado ,

 

As the sample you shared, I think that you want to correct the total, you can change your measure to following:

 

Test =
VAR t =
    FILTER (
        inliprix,
        inliprix[list_number] = SELECTEDVALUE ( inliprix[list_number] )
    )
RETURN
    SUMX (
        t,
        [price_list]
            * AVERAGEX ( FILTER ( 'Struc_act', Struc_act[Code-prod] = [Code-prod] ), [qty] )
    )

Measure-based-on-filters-slicers-1.png

 

BTW, pbix as attached.

 

Best regards,

 

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

Community Support Team _ Dong Li
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.