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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
surajde
Helper I
Helper I

PowerBI same column calculation

Hi, 

 

I need help for performing calculation within same column on PowerBI like I did it in MS Excel. 

=IF(A2<>A1, "NULL", F2). 

 

How to put this formula in DAX?

 

surajde_0-1681458294638.png

 

10 REPLIES 10
Ashish_Mathur
Super User
Super User

Hi,

It is easier to solve this in the Query Editor.  If you are interested, then share data in a format the can be pasted in an MS Excel file and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi @Ashish_Mathur , @lbendlin 

 

Here is the data you need. I need calculaiton in last two columns. Start time and Stop time. 

Start time : 

=IF(A2<>A1, "NULL", F2). 

 

Stop Time :

=IF(A3=A2, F3, "NULL")

 

TICKET_NUMTICKET_OPENEDSEVERITYACTIVITY_TYPETICKET_STATE1ACTIVITY_TIMESTART_TIMESTOP_TIME
3097037485/2/2022 13:214Customer LogQueued5/2/2022 13:21NULL5/2/2022 13:21
3097037485/2/2022 13:214Initial CreationQueued5/2/2022 13:215/2/2022 13:215/4/2022 13:57
3097037485/2/2022 13:214Customer LogQueued5/4/2022 13:575/4/2022 13:575/6/2022 15:17
3097037485/2/2022 13:214Customer LogQueued5/6/2022 15:175/6/2022 15:17NULL

Hi,

Would you be OK with a Query Editor solution?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi @Ashish_Mathur @lbendlin  

any luck on above mentioned query, please? 

why does the start_time need to be null for the first entry? Do you need a measure or is a calculated column enough?

Hi @lbendlin

A calulted column is enough. this way I will be able to count the actual differed time. 

 

surajde_0-1681731913352.png

 

@lbendlin Sorry for chasing you. But got any luck? 

why does the start_time need to be null for the first entry?

I think you're not reading formulas and data proper. You can try inserting dummy data to excel and use formulas given for Start_Time and Stop_Time then see the result. I need exact same replicated in PowerBI

lbendlin
Super User
Super User

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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