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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
dk_powerbiuser1
New Member

Need to apply productx calculation after applying a filter based on a measure value

Hi Team, 

I have a requirement to create  Product wise  Sale%  based on Itemwise Sale% under each product . 

Please see the below Screenshot . Actual , Planned and % Sales are measures

dk_powerbiuser1_0-1713602118923.png

Now I have a Range slicer which shows value 1 to 100 . I can change this value when needed . For now, I selected  value as  50

dk_powerbiuser1_1-1713602212405.png

 

Now, I am finding out  % based on slicer value by calculating Minimum and maximum Item value of actual and Planned  for each product and multiply with this slicer value  

 

example 

dk_powerbiuser1_3-1713602486159.png

I am creating a Flag, If Planned< % Based on Slicer Input then updating it as 0(zero) this record has to be excluded from Productwise Sales% calculation 

Productwise % Sales= product of %sales of each item

ex. For Product A Sale% = 100*100*50  . 75 excluded for calculation

Product B %Sales= 25*100*75 . 0 excluded for calculation.Similary for Product C Sales %= 10*0*100 , Product D Sale%= 0 

 

I Hope you got the requirement . Appreciate your valuable inputs 

 

 

 

 

 

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@dk_powerbiuser1 So, maybe this:

  VAR __Product = MAX('Table'[Product])
  VAR __Table = 
    FILTER( 
      SUMMARIZE(
        FILTER( ALL('Table'), [Product] = __Product ),
        [Product],
        [Item],
        "__%Sales", [%Sales],
        "__Flag", [Flag]
      ),
      [__Flag] > 0
    )
  VAR __Result = PRODUCTX( __Table, [__%Sales] )
RETURN
  __Result

Basically, the measure aggregation pattern. This looks like a measure aggregation problem. See my blog article about that here: https://community.powerbi.com/t5/Community-Blog/Design-Pattern-Groups-and-Super-Groups/ba-p/138149

The pattern is:
MinScoreMeasure = MINX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])
MaxScoreMeasure = MAXX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])
AvgScoreMeasure = AVERAGEX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])
etc.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

1 REPLY 1
Greg_Deckler
Community Champion
Community Champion

@dk_powerbiuser1 So, maybe this:

  VAR __Product = MAX('Table'[Product])
  VAR __Table = 
    FILTER( 
      SUMMARIZE(
        FILTER( ALL('Table'), [Product] = __Product ),
        [Product],
        [Item],
        "__%Sales", [%Sales],
        "__Flag", [Flag]
      ),
      [__Flag] > 0
    )
  VAR __Result = PRODUCTX( __Table, [__%Sales] )
RETURN
  __Result

Basically, the measure aggregation pattern. This looks like a measure aggregation problem. See my blog article about that here: https://community.powerbi.com/t5/Community-Blog/Design-Pattern-Groups-and-Super-Groups/ba-p/138149

The pattern is:
MinScoreMeasure = MINX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])
MaxScoreMeasure = MAXX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])
AvgScoreMeasure = AVERAGEX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])
etc.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors