Forum

Notifications
Clear all

MEASURE - DAX

4 Posts
2 Users
0 Reactions
90 Views
(@cristinagrig)
Posts: 5
Active Member
Topic starter
 

Hello everyone,

I'm stuck. PowerBI experts needed to help create a measure based on two different funding methods. My data has the following numeric fields: total number of hours attended, scheduled hours, FTE, LHE, and one alpha field "Funding Method" that takes two values - DE and PA.

For funding method 'DE', the ACS (average class size) will be calculated using the following formula: (FTES*525)/(LHE*30)
and for the 'PA' funding method the ACS will be calculated using (Total Attendance Hours/Cum Scheduled Hours)

What DAX should I use to create such measure? Is this even doable in Power BI?

Thank you in advance.
Cristina

 
Posted : 11/01/2023 2:03 pm
(@catalinb)
Posts: 1937
Member Admin
 

Hi Cristina,
This looks more like a calculated column, rather than a measure:
=IF([Funding Method]="PA", [Attendance Hours] / [Scheduled Hours], ([FTE]*525) / ([LHE]*30) )

 
Posted : 12/01/2023 1:29 am
(@cristinagrig)
Posts: 5
Active Member
Topic starter
 

Hi Catalin,

While the formula works for each row it does not for the Total row. That is why it must be a measure. Please see screenshot attached...see how the Total ACS is computed by adding the ACS value of rows 1 and 2... when it should be calculated again based on the formula in which case Total ACS will be 11.63 (the correct value).

Using measures takes care of this issue.

Thanks anyway (Multumesc oricum ptr. raspunsul rapid),

Cristina

 
Posted : 12/01/2023 6:54 pm
(@catalinb)
Posts: 1937
Member Admin
 

You can make a measure with the same formula, but Funding Method field should be added to pivot table to provide context for calculation.
Cheers,
Catalin

 
Posted : 15/01/2023 1:35 am
Share: