The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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:
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.
thank you in advance for your help
Solved! Go to Solution.
@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.
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
@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.
Thank you very much!
Indeed, it works as I expected!
Thank you once again!
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
81 | |
75 | |
52 | |
48 |
User | Count |
---|---|
134 | |
124 | |
78 | |
64 | |
63 |