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.
I have a large table with many columns including various amounts and period (year/month). I have a secondary table with a single row of various parameters about the data pull.
If I try and reference the period column in the secondary table in DAX then I get an error. However if I hard code the period from the secondary table then the new column is created correctly.
I am not sure I am doing the DAX the best way however this seemed to work
This seems to work:
Amount4_YTD = CALCULATE( sum(Project_Data[plA_Amount4_Year]) , Project_Data[Award] = "AWARD1" , FILTER( Project_Data, Project_Data[period] <= 201801 ))
This does not work:
pla_Amount4_YTD_HFR1 = CALCULATE( sum(Project_Data[plA_Amount4_Year]) , Project_Data[Award] = "HPIAA*" , FILTER( Project_Data, Project_Data[period] <= General_Environment[cperiod] ))
what am I missing?
Thanks
Alan
Insecond measure, General_Environment[cperiod] doesn't have a row context so i would expect the calculated column to fail. You need to wrap column in MAX, MIN, or some other scalar function.
Is there a relationship between the two tables?
I don't have a relation between the two tables. The General_Environment table has 1 row and a 2nd row with nulls that is preventing PowreBI from allwoing a relation. I am having trouble keepting the nulls out everytime out of my data.
I really liked your idea of wrapping the column in max(). That did not give an error, but seemed to give no results.
Amount4_YTD_HFR2 = CALCULATE( sum(Project_Data[plA_Amount4_Year]) , Project_Data[Award] = "HPIAA*" , FILTER( Project_Data, Project_Data[period] <= max(General_Environment[cPeroid] )))
thanks for the response and ideas
Alan
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 |
---|---|
114 | |
105 | |
78 | |
68 | |
63 |
User | Count |
---|---|
148 | |
107 | |
106 | |
83 | |
70 |