Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
i have asked Power Bi to create a DAX function to show me an individuals wealth based on slicers for individual, and month end dates but when i have copied this in to Power BI Desktop I keep getting error messages saying 'The syntax for '???' is incorrect. The ??? has been [Date], [Value] etc. and i have seemed to correct these but it is not saying 'The syntax for ',' is incorrect'. I have no idea what is causing this or how to correct. Can anyone help? I know it is long but the measure is below:
Solved! Go to Solution.
Hi @ARWCL
Based on your data and the final goal, i create the following measures.
Note:there are no relationships among tables.
MEASURE =
VAR filterdate =
IF (
ISFILTERED ( DateTable[Date] ),
MAX ( DateTable[Date] ),
MAXX ( ALLSELECTED ( 'Value'[Date] ), [Date] )
)
VAR filterassetid =
CALCULATETABLE (
VALUES ( 'FamilyMembers'[AssetID] ),
FamilyMembers[OwnershipStartDate] <= filterdate,
OR (
FamilyMembers[OwnerShipEndDate] >= filterdate,
ISBLANK ( FamilyMembers[OwnerShipEndDate] )
)
)
VAR maxdate =
MAXX (
FILTER (
ALLSELECTED ( 'Value' ),
[AssetID]
IN filterassetid
&& [AssetID]
IN VALUES ( 'Value'[AssetID] )
&& [Date] <= filterdate
),
[Date]
)
VAR maxvalue =
MAXX (
FILTER (
ALLSELECTED ( 'Value' ),
[Date] = maxdate
&& [AssetID]
IN VALUES ( 'Value'[AssetID] )
&& [AssetID] IN filterassetid
),
[Value]
)
VAR subvalue =
SUMX (
FILTER (
ALLSELECTED ( 'Value' ),
[ParentAssetID]
IN VALUES ( 'Value'[AssetID] )
&& [ParentAssetID]
IN filterassetid
&& [Date] <= filterdate
),
[Value]
)
VAR ownerper =
MAXX (
FILTER (
ALLSELECTED ( FamilyMembers ),
[AssetID]
IN VALUES ( FamilyMembers[AssetID] )
&& [AssetID]
IN VALUES ( 'Value'[AssetID] )
&& [AssetID] IN filterassetid
),
[OwnershipPercentage]
)
RETURN
( maxvalue + subvalue * ownerper ) * ownerper
Measure2 =
VAR a =
ADDCOLUMNS (
SUMMARIZE ( ALLSELECTED ( 'Value' ), [AssetID] ),
"Measure", [Measure]
)
RETURN
SUMX ( FILTER ( a, [AssetID] IN VALUES ( 'Value'[AssetID] ) ), [Measure] )
Then put the measure2 to the card.
Output
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @ARWCL
Based on your data and the final goal, i create the following measures.
Note:there are no relationships among tables.
MEASURE =
VAR filterdate =
IF (
ISFILTERED ( DateTable[Date] ),
MAX ( DateTable[Date] ),
MAXX ( ALLSELECTED ( 'Value'[Date] ), [Date] )
)
VAR filterassetid =
CALCULATETABLE (
VALUES ( 'FamilyMembers'[AssetID] ),
FamilyMembers[OwnershipStartDate] <= filterdate,
OR (
FamilyMembers[OwnerShipEndDate] >= filterdate,
ISBLANK ( FamilyMembers[OwnerShipEndDate] )
)
)
VAR maxdate =
MAXX (
FILTER (
ALLSELECTED ( 'Value' ),
[AssetID]
IN filterassetid
&& [AssetID]
IN VALUES ( 'Value'[AssetID] )
&& [Date] <= filterdate
),
[Date]
)
VAR maxvalue =
MAXX (
FILTER (
ALLSELECTED ( 'Value' ),
[Date] = maxdate
&& [AssetID]
IN VALUES ( 'Value'[AssetID] )
&& [AssetID] IN filterassetid
),
[Value]
)
VAR subvalue =
SUMX (
FILTER (
ALLSELECTED ( 'Value' ),
[ParentAssetID]
IN VALUES ( 'Value'[AssetID] )
&& [ParentAssetID]
IN filterassetid
&& [Date] <= filterdate
),
[Value]
)
VAR ownerper =
MAXX (
FILTER (
ALLSELECTED ( FamilyMembers ),
[AssetID]
IN VALUES ( FamilyMembers[AssetID] )
&& [AssetID]
IN VALUES ( 'Value'[AssetID] )
&& [AssetID] IN filterassetid
),
[OwnershipPercentage]
)
RETURN
( maxvalue + subvalue * ownerper ) * ownerper
Measure2 =
VAR a =
ADDCOLUMNS (
SUMMARIZE ( ALLSELECTED ( 'Value' ), [AssetID] ),
"Measure", [Measure]
)
RETURN
SUMX ( FILTER ( a, [AssetID] IN VALUES ( 'Value'[AssetID] ) ), [Measure] )
Then put the measure2 to the card.
Output
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@ARWCL very hard to tell from DAX expressions. It will be easier if you share pbix file using one drive/google drive with the expected output. Remove any sensitive information before sharing.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
See below images of the test tables and Power BI report i have tried to create. Should be really easy to replicate and test. Thank you
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
78 | |
75 | |
58 | |
36 | |
33 |
User | Count |
---|---|
100 | |
62 | |
56 | |
47 | |
41 |