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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

Calculate column

I everyone, I need for you.

I want create a new calculate colum with this sintax

 

if [DWH.GENNAIO] is null then [Ricavo pesato]/(([FineMese]+1) - [InizioMese]),Table.SelectRows([InizioMese] <= 1 && [FineMese] <= 1 then [DWH.GENNAIO]

 

I would like to create an if else with the condition that certain dates are filtered.
For example I say
if month is zero then revenue / month where month start <= 1 and month end <= 1 otherwise month.
In dax I did this:

 

Colonna 2 = IF(Merge1[DWH.GENNAIO] = BLANK(),CALCULATE(SUM(Merge1[Ricavo pesato])/SUM(Merge1[DiffMese]),Merge1[MeseInizio] <= 1 && 1 <= Merge1[MeseFine]),Merge1[DWH.GENNAIO])

 

but this formula gives me a problem when I create the high months, it tells me that there is a circular dependency and I believe it depends on the fact that I always use the condition:

 

start of month <= 1 and end of month <= 1

 

with different months

Thanks a lot to those who can help me

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@Anonymous 

This dax is not correctly written. I am sure what exact your are expecting but try the correct formula below:

 

Colonna 2 = IF(Merge1[DWH.GENNAIO] = BLANK(),
                           SUM(Merge1[Ricavo pesato])/CALCULATE(SUM(Merge1[DiffMese]), Filter(Merged,                                                 Merge1[MeseInizio] <= 1 && 1 <= Merge1[MeseFine])),
                           Merge1[DWH.GENNAIO])

 

However, I am confuse with the <=1 and >=1, doesn't this means all numbers? This probably causes the the circular dependency.

 

Paul Zheng _ Community Support Team

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

@Anonymous 

This dax is not correctly written. I am sure what exact your are expecting but try the correct formula below:

 

Colonna 2 = IF(Merge1[DWH.GENNAIO] = BLANK(),
                           SUM(Merge1[Ricavo pesato])/CALCULATE(SUM(Merge1[DiffMese]), Filter(Merged,                                                 Merge1[MeseInizio] <= 1 && 1 <= Merge1[MeseFine])),
                           Merge1[DWH.GENNAIO])

 

However, I am confuse with the <=1 and >=1, doesn't this means all numbers? This probably causes the the circular dependency.

 

Paul Zheng _ Community Support Team

lbendlin
Super User
Super User

You posted this in the Power Query section. Please confirm if you want M or DAX code. Please provide sample data in usable format (not as a picture) and show the expected outcome.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.