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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Verkana
New Member

Cost breakdown and changing of filtered value

Hello,

I kindly request help with my problem.

I need to define a measure that will be multiplied by another measure if the value of another field is empty and the filtered field will no longer empty, but will have value.

Or if there is another way, maybe in power query or editing „Accounting_data“ by adding columns –or something else, I will be thankful.

I’ll try to explain more specifically.

I have for example accounting data in table „Accounting_data“:

Date

Label

RefCin

Value

1.4.2022

Marketing cost

 

250,-

6.6.2022

Rent

1

380,-

5.5.2022

Wages

2

220,-

7.7.2022

Wages

3

150,-

1.2.2022

Rent

 

200,-

3.3.2022

IT services

 

450,-

4.4.2022

Wages

 

100,-

 

Then I have measure „Percentage“ (counted from another table).

RefCin-percentage

Percentage

1

15 %

2

25 %

3

60 %

 

Here is the quest:

I need to make measure for every RefCin:

  1. If the RefCin is filled by number (1,2,3) :
  • make sum of „Values“.
  1. But if the RefCin is empty, than
  • make sum of „Values“ where RefCin=0,
  • multiply by measure „Percentage“
  • Change RefCin (empty) to „RefCin“ (1,2,3)
  • Add to sum of values for RefCin in Step 1

Result:

RefCin-percentage

Year costs

1

380 + 0,15*(250+200+450+100) = 530

2

220 + 0,25*(250+200+450+100) = 470

3

150 + 0,6*(250+200+450+100) = 750

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Verkana ,

 

My Data model:

RicoZhou_0-1658469731855.png

RicoZhou_1-1658469739499.png

M_Percentage = CALCULATE(SUM('Table'[Percentage]))

Measure:

Measure = 
VAR _VALUE = CALCULATE(SUM(Accounting_data[Value]),FILTER(ALL(Accounting_data), Accounting_data[RefCin] =MAX('Table'[RefCin])))
VAR _BLANK = CALCULATE(SUM(Accounting_data[Value]),FILTER(ALL(Accounting_data), Accounting_data[RefCin] = BLANK()))
RETURN
_VALUE + [M_Percentage] * _BLANK

Result is as below.

RicoZhou_3-1658469803393.png

 

Best Regards,
Rico Zhou

 

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

1 REPLY 1
Anonymous
Not applicable

Hi @Verkana ,

 

My Data model:

RicoZhou_0-1658469731855.png

RicoZhou_1-1658469739499.png

M_Percentage = CALCULATE(SUM('Table'[Percentage]))

Measure:

Measure = 
VAR _VALUE = CALCULATE(SUM(Accounting_data[Value]),FILTER(ALL(Accounting_data), Accounting_data[RefCin] =MAX('Table'[RefCin])))
VAR _BLANK = CALCULATE(SUM(Accounting_data[Value]),FILTER(ALL(Accounting_data), Accounting_data[RefCin] = BLANK()))
RETURN
_VALUE + [M_Percentage] * _BLANK

Result is as below.

RicoZhou_3-1658469803393.png

 

Best Regards,
Rico Zhou

 

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

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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