Forum Discussion
Dynamic Calculation Different Period
- 3 months ago
Thankyou powerbidev123 for Addressing the issue.
Hi chrisyan_manalu ,Thank you for reaching out to Microsoft Fabric Community Forum,Below are the dax measure you can try to resolve your issue.
Using two separate date tables is the correct design if the requirement is to compare two completely independent date selections. However, the issue occurs because when YtdFinal is evaluated in a visual filtered by Period B, the filter context from DimDateTable2 propagates to the fact table, and your YtdNet measure is no longer isolated to Period A. The solution is to make each measure explicitly control which date table affects the fact table.
YtdNet = VAR SelectedDates = VALUES ( DimDateTable1[Date] ) RETURN CALCULATE ( [NetMeasure], REMOVEFILTERS ( DimDateTable2 ), TREATAS ( SelectedDates, FactSales[Date] ) )YtdSalesSQL = VAR SelectedDates = VALUES ( DimDateTable2[Date] ) RETURN CALCULATE ( [SalesSQL], REMOVEFILTERS ( DimDateTable1 ), TREATAS ( SelectedDates, FactSales[Date] ) )YtdSalesPostgre = VAR SelectedDates = VALUES ( DimDateTable2[Date] ) RETURN CALCULATE ( [SalesPostgre], REMOVEFILTERS ( DimDateTable1 ), TREATAS ( SelectedDates, FactSales[Date] ) )YtdFinal = [YtdNet] + [YtdSalesSQL] + [YtdSalesPostgre]Thanks & Regards,
Chaithanya.
Hi,
Please share the download link of the PBI file and show the problem there clearly. Please also share the downliad link of the Excel file shown in the screenshot.