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.
Hey to all,
It seems easy, but i'm having some troubles at the time, to do that measure,
I want to create a measure that counts the dates that are between two other dates, I mean, I have two columns, and I want to know the number of notes that have been done between the dates of the other column, I made that measure, that, theorically, it have to work, but it doesn't, and well, I don't know how to get my measure,
Solved! Go to Solution.
Hi @uvil
You may refer to below measure.If it is not your case,please share some sample data and expected output which would be helpful to provide an accurate solution.You can also upload the .pbix file to OneDrive and post the link here. Do mask sensitive data before uploading.
How to Get Your Question Answered Quickly
Measure = CALCULATE ( COUNTROWS ( 'Table 2' ), FILTER ( 'Table 2', 'Table 2'[Fecha_Aviso] >= MIN ( 'Table 1'[Fecha_NPS - Date] ) && 'Table 2'[Fecha_Aviso] <= MAX ( 'Table 1'[Fecha_NPS - Date] ) ) )
Regards,
In SQL, that query would be so good for me, but I don't know how to transform it in DAX
select * from Table
where YEAR(Fecha_Aviso) > 2018
and Fecha_Aviso>=(select MIN(Fecha_NPS) from Table)
and Fecha_Aviso<=(select MAX(Fecha_NPS) from Table)
I mean, now it's returning what a really need from the table, but I don't know how to translate it well to DAX,
Regards.,
I downloaded DAX Studio, and I worked with that platform,
This query is giving me the values that I expected,
EVALUATE
FILTER (
FILTER ( Table1, Table1[Fecha_Aviso] ),
AND (
CALCULATE ( SUM ( Table1[Fecha_Aviso] ) )
>= MIN ( Table1[Fecha_NPS - Date] ),
CALCULATE ( SUM ( Table1[Fecha_Aviso] ) )
<= MAX ( Table1[Fecha_NPS - Date] )
)
)
ORDER BY Table1[Fecha_NPS - Date]
But when I try to apply that formula to a measure in Power BI, it's giving me the next error:
The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value.
And I don't know why the formula is working in DAX Studio, but in the other way is failing in PBI,
Regards.,
Hi @uvil
You may refer to below measure.If it is not your case,please share some sample data and expected output which would be helpful to provide an accurate solution.You can also upload the .pbix file to OneDrive and post the link here. Do mask sensitive data before uploading.
How to Get Your Question Answered Quickly
Measure = CALCULATE ( COUNTROWS ( 'Table 2' ), FILTER ( 'Table 2', 'Table 2'[Fecha_Aviso] >= MIN ( 'Table 1'[Fecha_NPS - Date] ) && 'Table 2'[Fecha_Aviso] <= MAX ( 'Table 1'[Fecha_NPS - Date] ) ) )
Regards,
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 |
---|---|
112 | |
97 | |
85 | |
67 | |
59 |
User | Count |
---|---|
150 | |
120 | |
99 | |
87 | |
68 |