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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
AsenSK
Frequent Visitor

Using "DISTINCT" function inside "CALCULATE" to SUM distinct values from multiple columns

Hi 

 

As you can see in the tabel under, I want to sum priorMonth "Sales" by the distinct values of "AB" in DAX. I have a Date calender 

 

Exmp Forum.PNG

I tried to do this by the formula under: 
 
Dax_formula.PNG
 
1 ACCEPTED SOLUTION
AsenSK
Frequent Visitor

Thanks for replaying @WinterMist . That was not what I was looking for, but thanks anyway!

 

My solution:

I just created 2 distinct tabels for each dates and append both tabels into one tabel. 

View solution in original post

3 REPLIES 3
AsenSK
Frequent Visitor

Thanks for replaying @WinterMist . That was not what I was looking for, but thanks anyway!

 

My solution:

I just created 2 distinct tabels for each dates and append both tabels into one tabel. 

v-jianboli-msft
Community Support
Community Support

Hi @AsenSK ,

 

Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or if you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file after removing sensitive data.

 

Refer to:

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

 

Best Regards,

Jianbo Li

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

WinterMist
Impactful Individual
Impactful Individual

@AsenSK 

 

Hopefully this is helpful to you.  (My test data is slightly different.)

 

'Data' table is as follows:

 

WinterMist_0-1688654640197.png

 

WinterMist_1-1688654729673.png

 

WinterMist_2-1688654865712.png

 

 

The visual is now summing Prior Month Sales by distinct values of AB.

 

If I am mistaken on what you are looking for, perhaps you could show the desired results in an Excel screenshot.

 

Regards,

Nathan

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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