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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
RicardoLeivaG
Helper I
Helper I

Ayuda con indicador variable

Hola comidad tengo el siguiente tema, tengo una medida rapida creada que calcula un procentaje

 

% Contribucion = DIVIDE(SUM('det_factura20062020'[contribucion]); 140000000)
 
esto solo funciona si selecciono un mes, pero al seleccionar 2 o mas el monto de contribucion sube mientras la meta sigue fija en 140000000, como puedo comolar ese valor fijo en variable???? que aumente si sumo mas meses y que vuelva a  140000000 si lecciono solo 1???
 
 
 
1 ACCEPTED SOLUTION
mahoneypat
Microsoft Employee
Microsoft Employee

You could set that store that in a variable, and multiple that by the count of selected values.  However, an easier way might be a measure like this one:

 

Avg Monthly % Contribution = Averagex(Values(Table[Month]), [% Contribucion])

 

This will calculate the % Contribution for each month and give you the average value.

 

If this works for you, please mark it as solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

3 REPLIES 3
dax
Community Support
Community Support

Hi @RicardoLeivaG , 

I am not clear about your requirement? Did you mean that you will  always get 1 as result? If so, you need to check meaurse data tyoe and format to see whether it is demical and whether it shou multiple decimal places. And I don't understand the requirement of 140000000, could you please explain this in details(such as use your sample and expected output)?

Please do mask sensitive data before uploading.

Thanks for your understanding and support.
Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

the value of the formula that is expressed as 140,000,000 is the goal per month, what I need is that this value increases if 2 or more months are selected, and that it is only 1 if you select any month.

example

if the user selects january

% Contribution = DIVIDE (SUM ('det_factura20062020' [contribution]); (140000000 * 1))

If you select January and February
% Contribution = DIVIDE (SUM ('det_factura20062020' [contribution]); (140000000 * 2))
if you select June
% Contribution = DIVIDE (SUM ('det_factura20062020' [contribution]); (140000000 * 1))

mahoneypat
Microsoft Employee
Microsoft Employee

You could set that store that in a variable, and multiple that by the count of selected values.  However, an easier way might be a measure like this one:

 

Avg Monthly % Contribution = Averagex(Values(Table[Month]), [% Contribucion])

 

This will calculate the % Contribution for each month and give you the average value.

 

If this works for you, please mark it as solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.

Top Solution Authors