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
MiaZhao
Helper I
Helper I

Calculate a change type based on the detail

Hi Everyone,

 

I am new to pbi. I tried to classify the reason for the change number of our product.  

CustomerCategoryDateAmountCumulative totalChange Type
A011.11010New
A021.122New
A011.5-28reduction
A011.6414addtion
      
A012.1-95conversion
A022.1911conversion

 My problem is how to calculate the change type column? There are more than 2 product categories, only 01 and 02 can be converted. The following formula was not correct.

 

IF('DetailData'[Amount]<0&&'DetailData'[Category]="01"&&CALCULATE(sum('DetailData'[Amount]),FILTER(ALLEXCEPT('DetailData','DetailData'[Category],'DetailData'[Customer]),'DetailData'[Category]="02"&& 'DetailData'[Date]<= LOOKUPVALUE('Canlendar Date'[Date],'Canlendar Date'[Date],'DetailData'[Date])))>=0,"Conversion","Others"

 

 

1 ACCEPTED SOLUTION

Hi @v-jiascu-msft

 

Thank you for your reply. I think I have sorted it out. I draw a logical map to tell what is the condition for a conversion, and it was quite complicated. I used EARLIER to calculate the total until the current date as well. The problem was solved. 

 

Thanks again. Have a nice weekend. 🙂

 

Regards,

Mia

View solution in original post

2 REPLIES 2
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @MiaZhao,

 

As you said, the formula is wrong. So by what conditions that we can say it's "conversion"?

 

Best Regards,

Dale

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

Hi @v-jiascu-msft

 

Thank you for your reply. I think I have sorted it out. I draw a logical map to tell what is the condition for a conversion, and it was quite complicated. I used EARLIER to calculate the total until the current date as well. The problem was solved. 

 

Thanks again. Have a nice weekend. 🙂

 

Regards,

Mia

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