Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello Experts ,
I have scenario where I want to plot two measure in line graph/Table.
Below is the reference data:
For example: For Mid=45 ,F_Value=894. So I need to go back 894 seconds i.e 14.9 mins and I have to count F_Value <=5 for Mid=1 between Process time of 894 (i.e 04:00:00 in above Data Reference) and 14.9 mins back (approx 03:45:00)
And I want to plot against 894.
Similarly I want all F_value of Mid=45 on X-axis and Count of F_Value<=5 for Mid=1 against it.
I am not sure whether it is possible using Dax or not.
Note: Process Time column has sample data.You can input if required.
Any help would be highly appreciated.
--Mayur
Hi @mwadhwani,
You can create calculated columns below:
F_Minu = ROUND(Table1[F_Value]/60,0)
F_Time = 'Table1'[Time] -TIME(0,[F_Minu],0)
Then create a measure below:
Measure = var mint=MAX('Table1'[F_Time])
var maxt=MAX('Table1'[Time])
var currF=VALUE(RIGHT(MAX('Table1'[F_Minu]),1))
var currM=VALUE(LEFT(MAX('Table1'[F_Minu]),1))
return
CALCULATE(COUNTROWS('Table1'),FILTER(ALL(Table1),'Table1'[Time]>=mint && 'Table1'[Time]<=maxt && Table1[F_Value]<=currF && Table1[Mid]=currM))
You can download the attached pbix file to check if it meet your requirements.
Best Regards,
Qiuyun Yu
Thanks a ton @v-qiuyu-msft. It indeed helped me and took very close to my desired output.
In the pbix, I see output only for value 894.
I need all F_Value on x-axis whose Mid=45.
As we have a F_value=7895 and F_Minu calucalted as 132. If we go 132 mins back from respective (i.e 02:00:00) I see two F_Value<=5(whose Mid=1).
But I see only 894 on x-axis and not 7895.
Can you please clear my above query.
Thanks a lot again!!
Hi @mwadhwani,
As the X-axis is F_Value column, when it's 7895, F_Minu is 132 minutes, how do you compare it with F_Value and Mid, eg: F_Value<=1, Mid=2? Why it should compare like F_Value<=5(whose Mid=1). 7895 and 894 in the X-axis should be two different groups.
Best Regards,
Qiuyun Yu
Thank you @v-qiuyu-msft for the reply. Your expertise is helping me to resolve my other related queries as well.
I create two columns Start Time and End Time into another table with Mid=45.
And In one table I Keep Mid=1 data.
In your pbix Measure definition has variable as Min(Time) and max(Time) which is specific for F_Value 894. I guess thas the reason I am getting only 894 on X-axis.
I am not even sure as well whether it is achievevalbe or not.
Thanks
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
94 | |
83 | |
66 | |
59 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |