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,
I have the following problem, I need to filter a visual so that it shows me only the results of the selected dates. Does anyone know how I could do it?
I have the following metric that works correctly, but I need to apply it to a visual that returns TRUE or FALSE if it is in that date range, but I can't do it.
Test =
VAR minDate =
MIN ( 'Dim_Calendar'[Date] )
VAR maxDate =
MAX ( 'Dim_Calendar'[Date] )
RETURN
CALCULATE (
SUM ( 'tableA'[A] ),
FILTER (
Dim_1,
Dim_1[Start Date] <= maxDate
&& Dim_1[End Date] >= minDate
),
FILTER (
Dim_2,
Dim_2[Start Date] <= maxDate
&& Dim_2[End Date] >= minDate
)
)
Thanks!
@Anonymous , Try like
Test =
VAR minDate =
MINX ( allselected('Dim_Calendar'),'Dim_Calendar' [Date] )
VAR maxDate =
MAXX ( allselected('Dim_Calendar'),'Dim_Calendar' [Date] )
RETURN
CALCULATE (
SUM ( 'tableA'[A] ),
FILTER (
Dim_1,
Dim_1[Start Date] <= maxDate
&& Dim_1[End Date] >= minDate
),
FILTER (
Dim_2,
Dim_2[Start Date] <= maxDate
&& Dim_2[End Date] >= minDate
)
)
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 @amitchandak
It doesn't work as what I need is to filter only the display (table). The value it shows is correct but it brings me several records, what I need is for it to show me only the record that includes that date, that's why it seems to me that what I need is a value of TRUE or FALSE as a result to add it to the visualization .
Thanks!
Hi @Anonymous,
Perhaps you can try to create a filter that is not related to the fact table and use the measure on 'visual level filter' to filter records.
Applying a measure filter in Power BI - SQLBI
If the above is not help, can you please share a pbix or some dummy data that keep raw data structure with expected results? It should help us clarify your scenario and test to coding formula.
How to Get Your Question Answered Quickly
Regards,
Xiaoxin Sheng
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 |
---|---|
97 | |
95 | |
80 | |
77 | |
66 |
User | Count |
---|---|
130 | |
106 | |
105 | |
86 | |
72 |