cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Regular Visitor

## one field of a graph is not automatically filtered, while the other is

I have a Park table that corresponds to the Machines present in my company.
I have a column which is the ID of all my machines, and I only have unique IDs in my table.
The number of machines present in my company at a given moment T. This number of machines never varies, as I have no notion of period or time.

I have a second table that looks at the number of times a machine has broken down.
I'll have the ID of the machine that broke down and the period when it happened (202402).
if a machine breaks down twice, I'll get two lines:
X87DT 202401
X87DT 202402

We have a table link made by the ID column in relation (Park 1 - Now *)

I want to have, by period, the percentage of machines that have had a problem compared to the number of machines in my park, according to the period when the problem was detected (knowing that my number of machines in PARK must not be influenced by the period).

example:
I have 500 machines
In December 2023 I had 80 machines with a problem
in January 2024 I had 10 machines with a problem

so I want a graph like this:

16% 2%
202312 202401

For now, here's what I've done:

I have created a measure that calculates the number of Machines in my park:

Mat. (Q) = DISTINCTCOUNT('Park'[ID])

I did the same thing in my Maintenance table:
Equipment with tickets = DISTINCTCOUNT('Maintenance'[ID])

then I created a graph:

But when I add my other mesure I obtain this :

knowing that normally I should always have a number of Mat. (Q) equal to 500.

In this case, it's as if my period filter is influencing my Mat.(Q) value, even though I have no relationship with the period.

1 ACCEPTED SOLUTION
Super User

@VixtorineR , Based on what I got so far, if you want use count of all machine across period

You need a measure

Mat. (Q) =
CALCULATE(
DISTINCTCOUNT('Park'[ID]),
ALL('Maintenance')
)

If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

3 REPLIES 3

Hi @VixtorineR ,

if I understand you right, you want to have a measure "Mat. (Q)" which always returns the total number of machines - not affected by the time period?

Then I would recommend to put the DAX like this:

``Mat. (Q) = CALCULATE( DISTINCTCOUNT( 'Park'[ID] ), ALL( Park ) )``

The ALL statement makes sure, every row of the Park table will be counted - regardless of any filter (like the time period field from your other table).

If this helped, I would apprechiate you marking this answer as solution, otherwise do not hesitate to ask again.

Greetings, Tim

Super User

@VixtorineR , Based on what I got so far, if you want use count of all machine across period

You need a measure

Mat. (Q) =
CALCULATE(
DISTINCTCOUNT('Park'[ID]),
ALL('Maintenance')
)

If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Regular Visitor

Thank you very much!

Indeed, it works as I expected!

Thank you once again!

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.