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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
VixtorineR
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'm linked to Single

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:

VixtorineR_1-1707733922867.png

 

But when I add my other mesure I obtain this : 

VixtorineR_2-1707733982933.png

 

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.

 

thank you in advance for your help

1 ACCEPTED SOLUTION
amitchandak
Super User
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.

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

3 REPLIES 3
timalbers
Responsive Resident
Responsive Resident

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

amitchandak
Super User
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.

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Thank you very much!

Indeed, it works as I expected!

 

Thank you once again!

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!

December 2024

A Year in Review - December 2024

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