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! Learn more

Reply
Analitika
Post Prodigy
Post Prodigy

Calculate measure by column value in Power BI

Hello,

 

I have a table. I want to calculate a measure which checks if column A =0, the calculate(sales), else values comes from A column

How to implement this?

5 REPLIES 5
Signore_Ands
Advocate II
Advocate II

Hello @Analitika 

Could you add a Conditional Column, in the Query Editor, like this?

Signore_Ands_0-1654090785218.png


And then sum the new column?

Or am I missing part of the requirement?

Analitika_0-1654091642914.png

I need to make a measure which calculates like this: if column r =0, then Pardavimai DK+-50_5 else column[r].

Hi @Analitika ,

 

If you want to judge the column r if equal 0, you need the measure of this column r. It may be sum('table'[r]) or max('table'[r]). In any case, fields in digital format must be the result of aggregation in the table visual.

 

Based on this. measure should look like this.

 

Measure = 

IF( SUM('Table'[r]) = 0 , SUM( 'Table'[Pardavimai DK+-50_5]), SUM('Table'[r]) )

 

Best Regards

Community Support Team _ chenwu zhu

 

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

Sales is not a column it is a measure

what column is Sales based on?

would this work?

Calc_Sales =
VAR vColA = CALCULATE(SUM(Table1[Column A]), fiLTER(Table1,Table1[Column A]<>0))
VAR vColSales = CALCULATE(Table1[Sales], fiLTER(Table1,Table1[Column A]=0))

RETURN
vColA+vColSales

Signore_Ands_0-1654092140722.png

 

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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