The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hi everyone!
I posted yesterday a question and @CerebusBI could help me with a solution : https://community.powerbi.com/t5/DAX-Commands-and-Tips/Count-distinct-values-on-a-column-for-values-...
This measures from my questioins are part of a major measure to calculate MTBF (Mean Time Between Fails) with data i have.
So, another question...
I have to calculate a sum of diference between the Maximum date and Minimum date with each "Name of Product", excluding the Products who appears once time, so the example table is:
Name of Product | Open date fail |
Product 1 | 01/25/2021 |
Product 2 | 03/15/2021 |
Product 2 | 03/20/2021 |
Product 1 | 01/15/2021 |
Product 3 | 04/02/2021 |
Product 1 | 12/08/2021 |
Product 1 | 10/13/2021 |
Being the maximum date locked, because i have to get always the last Thursday (refreshed automatically everyday when i publish repport):
MaxDate =
And the minimum date must be the MinDate of each Product, except the products that only appear once:
The measure i use until now:
Name of Product | MinDate |
Product 1 | 01/15/2021 |
Product 2 | 03/15/2021 |
So, the Measure who i need results in:
Sum of (MaxDate - MinDate) excluding the Products who appears once time. (I must use a Card graphic and Table Graphic)
Can anyone help me with this?
Thank to the whole community, for everything!
Solved! Go to Solution.
Hi,
You can achieve this using DATEDIFF, SUMX and some filters.
e.g.
Data:
Dax:
I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!
Proud to be a Super User!
Hi,
You can achieve this using DATEDIFF, SUMX and some filters.
e.g.
Data:
Dax:
I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!
Proud to be a Super User!
User | Count |
---|---|
15 | |
13 | |
9 | |
6 | |
6 |
User | Count |
---|---|
27 | |
19 | |
13 | |
9 | |
5 |