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

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

Reply
lovedata
Frequent Visitor

How to create a measure to display values based on conditions on period of time

 

 

 

 


277470928_5380800388596768_2015435528188765035_n.jpeg

 

Hi Power BIgurus, I have a very strange scenario I want to visualize in Power BI. I am not sure how I can achieve it and your help would be really appreciated here.

 

What I am trying to achieve is that I want to calculate weighted price (Volume*Price) for multiple vendors over time. However, this condition is only applicable if there are no multiple contracts with the same vendors or multiple vendors over the same period of time. In that case, we only need to display the price only, without multiplying it by its Volume, as it is already weighted by the customer.  I tried to illustrate my goal with a hand sketch above. W = volume and P is price. So I want to multiply the column by the price If there is no other contract for the given period of time and just the price if there is another contract for the given period of time. How can I achieve this in DAX, please?

 

Please beware that both fields come from the same table. The field's names are W for volume and P is for the price, let's assume. 

 

 

1 REPLY 1
v-chenwuz-msft
Community Support
Community Support

Hi @lovedata ,

 

Please share some sample data or screenshot without sensitive data and expect result. I apologise as I am not entirely understanding "display the price only, without multiplying it by its Volume", is that your volume is %?

 

How to Get Your Question Answered Quickly - Microsoft Power BI Community

 

Or this expression you can try.

measure =
VAR _s =
    SUMMARIZE (
        'table',
        [vendors],
        [W],
        [P],
        "%", DIVIDE ( [W], CALCULATE ( SUM ( [W] ), ALLSELECTED ( 'table'[vendors] ) ) )
    )
RETURN
    SUMX ( _s, [%] * [P] )

Best Regards

Community Support Team _ chenwu zhu

 

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

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.