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
leandro41
New Member

measure to devide data with 100% all situations

Hello guys
I'm creating a measure to generate an S-curve of predicted and realized as a percentage of existing values.

It turns out that when filtering the entire dataset from one filter, for example, territory, it divides the value between north and south, with south, being 75% and north 25% and the total percentage value of the entire set is 100%.

I need that when filtering the South set, it brings 100% and the North 100%, since it is only that territory.

The measurements I'm using are:

Tarefas Media =
DIVIDE(
    CALCULATE(COUNTROWS(Extrato_SDI),ALLSELECTED(Extrato_SDI)),
    CALCULATE(COUNTROWS(Extrato_SDI),ALL(Extrato_SDI)),0)

 

Tarefas Provisionadas Total pev =
CALCULATE([Tarefas Media],FILTER(ALLSELECTED(Extrato_SDI),Extrato_SDI[Prazo Conclusão Tarefa] <= MAX(Calendario[Data])))

Tarefas Realizadas Acomuladas per =
var vRA =    CALCULATE( [Tarefas Media],FILTER(ALLSELECTED('Extrato_SDI'),Extrato_SDI[Data Efetiva de Conclusão Tarefa] <= MAX('Calendario'[Data]) && 'Extrato_SDI'[Status Tarefa Id] = 3))
RETURN
IF(MAX(Calendario[Data]) >TODAY(),BLANK(),vRA)

How do you create a way to filter the values and always bring the part, like 100%, and the whole, like 100%?

2 REPLIES 2
leandro41
New Member

@some_bih 
I Attachment a figure to show us about this.
Filter Norte

leandro41_1-1720026543472.png


Filter SUL

leandro41_2-1720026627861.png

All measure in dashboard

leandro41_3-1720026670158.png

 

My intention is that in a predicted measurement, I can filter the north and south, and, if there is no filter, the total value will appear. And activating the other filters in the report as well

 

some_bih
Super User
Super User

Hi @leandro41 your first measure  definition,[Tarefas Media],  include DAX function ALLSELECTED, [Tarefas Media].

This is ok if you use that measure for visuals.

Still, in your case this measure is used in another measures which is not good practice as results are almost impossible to figure out what are they.

Best practice for ALLSELECTED: use it for visuals not as input for other measures.

 

Rewrite code/s or provide simple file with input and expected output to provide possible solutions. Your request seems regular 🙂





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

Proud to be a 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!

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.