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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
augustindelaf
Impactful Individual
Impactful Individual

Dax Measure IF > sum/Average & format$/format%

Hi All, 

 

simple question for you, I'm sure.

I have a "IF" measure that works fine (moduling sum or average for a same field), I just want to add some "Format" arguments  in it, can you help me please?

Here is the measure that works : 

 

VarKPI2MonthlyActual =
IF('DATA(Update KPIs)'[SelectedValue] ="WS 3.5";
AVERAGE('DATA(Update KPIs)'[KPI 2 Monthly Actual]);
SUM('DATA(Update KPIs)'[KPI 2 Monthly Actual]))

 

Here is the measure that I want : 

 

VarKPI2MonthlyActual =
IF('DATA(Update KPIs)'[SelectedValue] ="WS 3.5";
AVERAGE('DATA(Update KPIs)'[KPI 2 Monthly Actual]);  FORMAT ('DATA(Update KPIs)'[KPI 2 Monthly Actual]);"Currency";
SUM('DATA(Update KPIs)'[KPI 2 Monthly Actual]))         FORMAT ('DATA(Update KPIs)'[KPI 2 Monthly Actual]);"Percent"

 

it doesn't work, can you please help me ?

thanks !

1 ACCEPTED SOLUTION
Anonymous
Not applicable

VarKPI2MonthlyActual =
IF (
    'DATA(Update KPIs)'[SelectedValue] = "WS 3.5";
    FORMAT ( AVERAGE ( 'DATA(Update KPIs)'[KPI 2 Monthly Actual] )"Currency" );
    FORMAT ( SUM ( 'DATA(Update KPIs)'[KPI 2 Monthly Actual] )"Percent" )
)

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

VarKPI2MonthlyActual =
IF (
    'DATA(Update KPIs)'[SelectedValue] = "WS 3.5";
    FORMAT ( AVERAGE ( 'DATA(Update KPIs)'[KPI 2 Monthly Actual] )"Currency" );
    FORMAT ( SUM ( 'DATA(Update KPIs)'[KPI 2 Monthly Actual] )"Percent" )
)

@Anonymous

perfect !

 

so angry that syntax is not easy for me, but it should be.

I tried to encapsulate but it didn't work... 😞 now it is fine !

 

thank you 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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