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
dwhittaker1
Helper II
Helper II

understanding a DAX formula

I am having a heard time Understanding the formula below. I am trying to place the following measure in a table
 
Price Impact - Sales - CY vs PY $ =
IF(
    [Price per Unit - PY $]=BLANK(),
        BLANK(),
        SUMX(
            FILTER(
                ALL(  FactSalesInvoiceLine[InvoiceItemID],FactSalesInvoiceLine[InvoiceMonth] ),
                [Price per Unit - PY $] > 0
                ),
            CALCULATE([Unit Quantity - CY]*[Price per Unit - CY vs PY $])
        )
)
 
 
I placed the measure in the table below as shown below. The measure returns a summarized value on each row,   how can i adjust the measure to look at each row and provide a calculation for each row instead summarizing the value in each row. for example row 1 unit quanity of 2100 * price per unit of .17 should return a value of 357
 
dwhittaker1_0-1710278074895.png

 

 
 
 
 
2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Hi @dwhittaker1 

 

I simply restored your data, all but "Price Impact - Sales - CY vs PY $" are the source data.

vxuxinyimsft_0-1710296747822.png

 

I created a measure as follows.

Price Impact - Sales - CY vs PY $ = 
IF(
    MAX([Price per Unit -PY $]) = BLANK(),
        BLANK(),
        SUMX(
            FILTER(
                FactSalesInvoiceLine,
                [Price per Unit -PY $] > 0
                ),
            [Unit Quantity - CY] * [Price per Unit - CY vs PY $]
        )
)

 

Result:

vxuxinyimsft_1-1710296810667.png

 

If this is not your desired outcome, please show your desired outcome in excel form.

 

Best Regards,
Yulia Xu

 

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

Anonymous
Not applicable

Hi @dwhittaker1 

 

[Price per Unit - PY $] is a measure?

 

If so, please try removing MAX. I don't have your source data, so in my test the field is column need to use MAX.

 

Best Regards,
Yulia Xu

 

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

4 REPLIES 4
dwhittaker1
Helper II
Helper II

@Anonymous 

 

thanks for the response, I get  a message that says The MAX function only accepts a column reference as the argument  number 1

dwhittaker1_0-1710298761711.png

 

Anonymous
Not applicable

Hi @dwhittaker1 

 

[Price per Unit - PY $] is a measure?

 

If so, please try removing MAX. I don't have your source data, so in my test the field is column need to use MAX.

 

Best Regards,
Yulia Xu

 

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

Hi,

Share the download link of the PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi @dwhittaker1 

 

I simply restored your data, all but "Price Impact - Sales - CY vs PY $" are the source data.

vxuxinyimsft_0-1710296747822.png

 

I created a measure as follows.

Price Impact - Sales - CY vs PY $ = 
IF(
    MAX([Price per Unit -PY $]) = BLANK(),
        BLANK(),
        SUMX(
            FILTER(
                FactSalesInvoiceLine,
                [Price per Unit -PY $] > 0
                ),
            [Unit Quantity - CY] * [Price per Unit - CY vs PY $]
        )
)

 

Result:

vxuxinyimsft_1-1710296810667.png

 

If this is not your desired outcome, please show your desired outcome in excel form.

 

Best Regards,
Yulia Xu

 

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

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