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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Cyriackpazhe
Helper II
Helper II

Calculated column

Screenshot (25).pngScreenshot (26).pngMy intention is to produce the total sales of each day in each row. But here I'm only getting the values of the respective rows in the column. What is the issue with the above code

2 ACCEPTED SOLUTIONS
quantumudit
Super User
Super User

Hello @Cyriackpazhe 

I don't think you need MAX() function, i.e., you can just use the following:

 

 

VAR Maxxx = Sales[Order Date]

 

 

Also in the FILTER(), use the entire table instead and not just the Sales[Order Date] column and no need to use ALL() function.

 

Could you please try doing this small change and see if you are getting the desired results or, not.

 

Here is one of the example DAX:

Col = 
VAR Maxxx = financials[Date]
VAR Total = CALCULATE(
    SUM(financials[ Sales]),
    FILTER(
        financials,
        financials[Date] = Maxxx
    )
)
RETURN
Total

 

I am also attaching a sample report for your reference.

 

Best Regards,
Udit

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudo 👍

🚀 Let's Connect: LinkedIn || YouTube || Medium || GitHub
Visit My Linktree: LinkTree

 

Proud to be a SuperUser

View solution in original post

Hi @Cyriackpazhe 

 

I'm questioning the sales figure of 3578.28 for that date. Since that's the only sale listed, could you double-check by filtering the Order Date?

 

If possible, sharing a PBIX file with anonymized data would be very helpful.

 

My concern stems from how the FILTER() function works. It creates a virtual table. Using just the Order Date column doesn't inherently link to sales.

 

We need to create that filtered virtual table and then sum the sales within it. That's why the claim of 3578.28 being the only sale on that date seemed potentially inaccurate.

 

Thanks,

Udit

 

 

 

 

View solution in original post

5 REPLIES 5
quantumudit
Super User
Super User

Hello @Cyriackpazhe 

I don't think you need MAX() function, i.e., you can just use the following:

 

 

VAR Maxxx = Sales[Order Date]

 

 

Also in the FILTER(), use the entire table instead and not just the Sales[Order Date] column and no need to use ALL() function.

 

Could you please try doing this small change and see if you are getting the desired results or, not.

 

Here is one of the example DAX:

Col = 
VAR Maxxx = financials[Date]
VAR Total = CALCULATE(
    SUM(financials[ Sales]),
    FILTER(
        financials,
        financials[Date] = Maxxx
    )
)
RETURN
Total

 

I am also attaching a sample report for your reference.

 

Best Regards,
Udit

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudo 👍

🚀 Let's Connect: LinkedIn || YouTube || Medium || GitHub
Visit My Linktree: LinkTree

 

Proud to be a SuperUser

Screenshot (27).pngAs you can see, the result is incorrect. In the first row the the value should have been 3578.28 because that is the only sales on that particular date.
Also Why couldn't i use a column filter instead of table filter before. 
 

Hi @Cyriackpazhe 

 

I'm questioning the sales figure of 3578.28 for that date. Since that's the only sale listed, could you double-check by filtering the Order Date?

 

If possible, sharing a PBIX file with anonymized data would be very helpful.

 

My concern stems from how the FILTER() function works. It creates a virtual table. Using just the Order Date column doesn't inherently link to sales.

 

We need to create that filtered virtual table and then sum the sales within it. That's why the claim of 3578.28 being the only sale on that date seemed potentially inaccurate.

 

Thanks,

Udit

 

 

 

 

Yes, what you said was right. That was not the only sales on that day. Thank you

Hello @Cyriackpazhe 

 

Please consider Accepting my original response to your query as the solution to help the other members find it more quickly.

 

Best Regards,
Udit

Appreciate your Kudo 👍

🚀 Let's Connect: LinkedIn || YouTube || Medium || GitHub
Visit My Linktree: LinkTree

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.