Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Problem defining measure in report

The table below indicates a minimal example of my raw data:

 

ProductOrder DayCustomerUnits OrderedUnits Delivered
PApr 1X43
PApr 2X43
PApr 1Y31
PApr 1Z31
QApr 1Z31
QApr 2W32
RApr 3X10
RApr 4Y20
RApr 5Z88
RApr 6Z66

 

Based on this I am able to create the following table as a PBI report where I give a product summary:

 

ProductDiff. Customers OrderedTotal OrderedTotal DeliveredService RateProduct-level Service Test
P31480.571
Q2630.50
R317140.821

 

This final column in the above summary checks whether more then 50% is being delivered. This report can be filtered on Order Day (time filter) as well as Customers.

 

Now, in a similar fashion, I would like to create a customer summary report:

 

Customer# diff. Product Ordered# Products Passing Service Test
X21
Y20
Z31
W11

 

It basically summarizes the product report after filtering for specific customers. My problem is the final column called "Products Passing Service Test". I am not able to define an appropriate measure in order to get the right numbers displayed in this column. I tried some other approaches but then it does not work well with the time filter on Customer Orders.

 

Anyone that can help? Thank you very much!

 

  • Hi Anonymous 

    If you have already written a measure Product-level Service Test, then you should be able to write Products Passing Service Test like this (I assumed the table is named Orders) :

     

    Products Passing Service Test = 
    SUMX ( 
        VALUES ( Orders[Product] ),
        [Product-level Service Test]
    )

     

     

     

    This measure iterates over Products visible in the current filter context, and sums [Product-level Service Test] for each. This will respond to any filters you have applied.

     

    Does this work as expected in your model?

     

    Regards,

    Owen

2 Replies

  • Hi Anonymous 

    If you have already written a measure Product-level Service Test, then you should be able to write Products Passing Service Test like this (I assumed the table is named Orders) :

     

    Products Passing Service Test = 
    SUMX ( 
        VALUES ( Orders[Product] ),
        [Product-level Service Test]
    )

     

     

     

    This measure iterates over Products visible in the current filter context, and sums [Product-level Service Test] for each. This will respond to any filters you have applied.

     

    Does this work as expected in your model?

     

    Regards,

    Owen

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you very much! This worked as requested. -- AYK