Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
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,
User | Count |
---|---|
98 | |
76 | |
69 | |
53 | |
27 |