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

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.

Reply
yanivvl
Frequent Visitor

Why DATESYTD with another filter do not work inside CALCULATE ?

hi , i have a model like that:

 mdl1.PNG

and i have a mesure in Buildings like that :

 

bl_Ytd_YhdCrntStg = CALCULATE(  SUM(  Dim_Buildings[HousingUnits]  ) ,Dim_BuildingConstructionProgress,Dim_BuildingConstructionProgress[is_current]=1  ,  DATESYTD( Dim_Time_BldCnstPrgrs[DT_Date])    )  

as you can see i am trying to sum HousingUnits and to use 2 filters : is_current=1 ; DATESYTD .

the problem is that DATESYTD  do not work when its with  is_current=1 , And also not in the opposite direction ,

can anybody tell me why ?  THANKS!

 

1 ACCEPTED SOLUTION

THANKS Lydia - BIG HELP !!!

TO QOMMUNTY HERE IS THE SOLUTION BY LYDIA :

 

Measure 1 = CALCULATE(CALCULATE( SUM( Dim_Buildings[HousingUnits] ) , DATESYTD( Dim_Time_BldCnstPrgrs[DT_Date])),Dim_BuildingConstructionProgress[is_current]=1 ) 

 OR

Measure 2 = CALCULATE( TOTALYTD(SUM(Dim_Buildings[HousingUnits]),Dim_Time_BldCnstPrgrs[DT_Date]),Dim_BuildingConstructionProgress[is_current]=1)

 Man Happy

View solution in original post

4 REPLIES 4
v-yuezhe-msft
Employee
Employee

@yanivvl,

What fields do you use to create relationship among the above three tables? Would you please share sample data of the three tables?

In addition, do you get expected result when you use existing fields inn the three tables to create visual?


Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

hi , here is the relationship  :

rlt1.PNGrlt2.PNG               

   i will be glad to add samPle of data or pbix file but i dont knwo how to do it , there is no attach file option here ..

and yes , i get the expected results even with other time function.  THANKS!

@yanivvl

You can upload PBIX file to OneDrive, and share me the shared link of the PBIX file via Private Message.

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

THANKS Lydia - BIG HELP !!!

TO QOMMUNTY HERE IS THE SOLUTION BY LYDIA :

 

Measure 1 = CALCULATE(CALCULATE( SUM( Dim_Buildings[HousingUnits] ) , DATESYTD( Dim_Time_BldCnstPrgrs[DT_Date])),Dim_BuildingConstructionProgress[is_current]=1 ) 

 OR

Measure 2 = CALCULATE( TOTALYTD(SUM(Dim_Buildings[HousingUnits]),Dim_Time_BldCnstPrgrs[DT_Date]),Dim_BuildingConstructionProgress[is_current]=1)

 Man Happy

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.