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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

conditional calculation based on various column values

Dear team, 

 

Please help me with a solution for problem statement 

 

Date    Parameter   Unit     Value   Reason 

20/6           P1         MW       10         Boiler

20/6           P1         Hours     8          Boiler

20/6           P2         MW       12         Turbine

20/6           P2         Hours     9          Turbine

20/6           P3         MW       11         Boiler

20/6           P3         Hours     9.5        Boiler

 

21/6           P1         MW        9          Boiler

21/6           P1         Hours     8          Boiler

21/6           P2         MW       15         Turbine

21/6           P2         Hours     9          Turbine

21/6           P3         MW       11          Grid

21/6           P3         Hours     9.8        Grid

 

From this, I want to calculate 

 

Measure 1= Boiler MW total (when Reason == Boiler and Unit = MU)  =  10+11+9 = 30

Measure 2= Boiler Hours total (when Reason == Boiler and Unit = Hours)  =  8 + 9.5 +8 = 25.5

 

Measure 3= Turbine MW total (when Reason == Turbine and Unit = MU)  

Measure 4= Turbine Hours  total (when Reason == Turbine and Unit = Hours )  

 

Basically I want to calculate the addition of values when Reason = " " && unit =" " for selected number of dates as per user( in this case 20/6 & 21/6)

 

Please help me!

 

1 ACCEPTED SOLUTION
v-diye-msft
Community Support
Community Support

Hi @Anonymous 

 

Let me know if you'd like to get below one:

4.gif

Pbix attached

Community Support Team _ Dina Ye
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

2 REPLIES 2
v-diye-msft
Community Support
Community Support

Hi @Anonymous 

 

Let me know if you'd like to get below one:

4.gif

Pbix attached

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

@Anonymous 

What's the expected output of your sample data?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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