Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi
Am trying to create a calculated table with filter on selected dates (Quarter mindate and maxdate).
and my DAX is as follows:
filteredbyQtr =
VAR mindate =
MIN ( 'Date'[Date] )
VAR maxdate =
MAX ( 'Date'[Date] )
VAR result =
CALCULATETABLE (
Sales,
FILTER ( sales, Sales[SaleDate] >= mindate && Sales[SaleDate] <= maxdate )
)
RETURN
result
But seems this doesnt work... always returns full records.
Solved! Go to Solution.
Hi @PBIDataNerd ,
Tables and columns in PBI are ALWAYS STATIC.They're recalculated when data is refreshed.
Measures are dynamic and the value will change with slicer or other filtering methods.
You can try to apply the following measure =1 in the visual level filter as workaround:
filteredbyQtr =
VAR mindate =
MIN ( 'Date'[Date] )
VAR maxdate =
MAX ( 'Date'[Date] )
RETURN
IF(MAX('SALES'[SaleDate])>=mindate &&MAX('SALES'[SaleDate])<=maxdate,1,0)
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @PBIDataNerd ,
Tables and columns in PBI are ALWAYS STATIC.They're recalculated when data is refreshed.
Measures are dynamic and the value will change with slicer or other filtering methods.
You can try to apply the following measure =1 in the visual level filter as workaround:
filteredbyQtr =
VAR mindate =
MIN ( 'Date'[Date] )
VAR maxdate =
MAX ( 'Date'[Date] )
RETURN
IF(MAX('SALES'[SaleDate])>=mindate &&MAX('SALES'[SaleDate])<=maxdate,1,0)
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@PBIDataNerd , You can not use Slicer values in a new calculated table.
hmm.. is there a way to just show only the dates which got sale and are within the selected quarter.
@PBIDataNerd , Only in visual tables using measures.
Variable using var in dax measure can have calculatedtable using slicer value
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
13 | |
13 | |
12 | |
8 | |
7 |
User | Count |
---|---|
18 | |
14 | |
11 | |
11 | |
9 |