Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
PiotrP
New Member

The sum depends on the measures taken from the date filter

 

Hello, I would like to ask for help with the measure which should be dynamic from the DWDateKey date filter:

 

1.png

 

the filter uses two measures that take min and max date minus one year:

 

Data max = DATE(YEAR(max(ERP_Invoice_product_region_WZ_budzet_Data[DWDateKey]))-1,MONTH(max(ERP_Invoice_product_region_WZ_budzet_Data[DWDateKey])), DAY(max(ERP_Invoice_product_region_WZ_budzet_Data[DWDateKey])))
 
and
 
Data min = DATE(YEAR(min(ERP_Invoice_product_region_WZ_budzet_Data[DWDateKey]))-1,MONTH(min(ERP_Invoice_product_region_WZ_budzet_Data[DWDateKey])), DAY(min(ERP_Invoice_product_region_WZ_budzet_Data[DWDateKey])))
 
 and the main measure that is to sum the value taking into account the two above-mentioned measure
 
Miara 2 = CALCULATE (
SUM ( ERP_Invoice_product_region_WZ_budzet_Data[prowartnetto] ),
FILTER (
ALL( ERP_Invoice_product_region_WZ_budzet_Data ),
ERP_Invoice_product_region_WZ_budzet_Data[DWDateKey] >= [Data min]
&& ERP_Invoice_product_region_WZ_budzet_Data[DWDateKey] <= [Data max]
))
3 REPLIES 3
selimovd
Super User
Super User

Hey @PiotrP ,

 

what exactly is your question?

 

Best regards

Denis

I would like to display the sum from the table ERP_Invoice_product_region_WZ_budzet_Data [prowartnetto] where I have a date filter that displays the min and max date from the filter. I reduce the minimum and maximum dates by one year. and in this option the measure will be the sum of the table ERP_Invoice_product_region_WZ_budzet_Data [prowartnetto] in the range of dates resulting from the measures of min and max dates. I apologize for my English

measure: Measure 2 = CALCULATE ( SUM (ERP_Invoice_product_region_WZ_budzet_Data [prowartnetto]), FILTER ( ALL (ERP_Invoice_product_region_WZ_budzet_Data), ERP_Invoice_product_region_WZ_budzet_Data [DWDateKey]> = [Date min] && ERP_Invoice_product_region_WZ_budzet_Data [DWDateKey] <= [Data max] )) it does not return any value to me. And it should be because between dates I have items that should add up. I do not know if the measure and the idea of display data is correct

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.