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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
ey_jitendra
Regular Visitor

Need to show measure wise aggregations. I have create item wise measure, need measure wise #items.

Hi All,

Really hope someone is able to guide me with my problem here. In my scenario, every item is sourced from different vendors.

Ask here to find price difference between lowest and highest sourcing.

ex:

itemactual_price_inr
110370553
110370600.53
110370656.59
110370656.6
2148601738
2148601839
2148601910

will return 

itemL1PriceH1PriceH1L1DiffDiffFlag
110370553656.619%11-19%
2148601738191010%0-10%

 

Now I want this Diff flag wise count of items like

DiffFlagCount of items
11-19%1
0-10%1

 

But when I take DiffFlag wise count of items, everything goes for a toss.

ey_jitendra_0-1654662596798.png

Following are my measures

H1Price =

VAR current_row_item = MIN(purchase_history_metric[item])
VAR current_row_category = MIN(purchase_history_metric[category])

RETURN
CALCULATE(
MAX(purchase_history_metric[actual_price_inr]),
FILTER(
ALL(purchase_history_metric),
purchase_history_metric[actual_price_inr]>0&&
purchase_history_metric[item] = current_row_item&&
purchase_history_metric[category] = current_row_category
)
)

 

 

 

L1Price =

VAR current_row_item = MIN(purchase_history_metric[item])
VAR current_row_category = MIN(purchase_history_metric[category])

RETURN
CALCULATE(
MIN(purchase_history_metric[actual_price_inr]),
FILTER(
ALL(purchase_history_metric),
purchase_history_metric[actual_price_inr]>0&&
purchase_history_metric[item] = current_row_item&&
purchase_history_metric[category] = current_row_category
)
)

 

H1L1Diff = divide(purchase_history_metric[H1Price]-purchase_history_metric[L1Price],purchase_history_metric[L1Price])

 

H1L1Flag = if(purchase_history_metric[H1L1Diff]<=0.1,"0-10%",IF(purchase_history_metric[H1L1Diff]<=0.2,"11-20%",BLANK()))

 

Please help

@amitchandak @Ashish_Mathur @SpartaBI @MFelix 

1 REPLY 1
v-easonf-msft
Community Support
Community Support

Hi, @ey_jitendra 

Your field [actual_price_inr] seems to be missing data, can you provide your demo for testing?

Best Regards,
Community Support Team _ Eason

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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