Forum Discussion
Comparison Table
- 1 year ago
Hi Warrior42 ,
Thanks for reaching out to the Microsoft fabric community forum.Working DAX Code Comparison Table
Comparison Firm = DISTINCT('Models'[Firm Name])
Measure → Return of Selected Model (Model 1)
Return_Model1 =
CALCULATE(
AVERAGE('Models'[Return (%)]),
REMOVEFILTERS('Models'[Firm Name])
)Purpose: Returns average return for Model 1, selected by slicer on Models.
Measure → Return of Comparison Model (Model 2)
Return_Model2 =
VAR SelectedComparison = SELECTEDVALUE('Comparison Firm'[Firm Name])
RETURN
CALCULATE(
AVERAGE('Models'[Return (%)]),
'Models'[Firm Name] = SelectedComparison
)Purpose: Returns average return for Model 2, chosen by slicer on Comparision Firm
Measure → Return Difference
Return_Difference = [Return_Model1] - [Return_Model2]
Purpose: Displays the difference between the two selected model returns.
Measure → Comparison Name
Comparison_Name =
VAR Model1 = SELECTEDVALUE('Models'[Firm Name])
VAR Model2 = SELECTEDVALUE('Comparison Firm'[Firm Name])
RETURN
IF(
ISBLANK(Model1) || ISBLANK(Model2),
BLANK(),
Model1 & " vs " & Model2
)Purpose: Useful for card visuals showing what you are comparing.
Matrix Visual Setup
Rows - MorningStar Category
Columns - ReturnModel1, ReturnModel2, Return_Difference
Slicers (on the page):
-
Models - For Model 1
-
ComparisionFirm - For Model 2 (Comparison)
If the response has addressed your query, please Accept it as a solution and give a 'Kudos' so other members can easily find it.
Best Regards,
Tejaswi.
Community Support -
Hi Warrior42 ,
Thanks for reaching out to the Microsoft fabric community forum.
Working DAX Code Comparison Table
Comparison Firm = DISTINCT('Models'[Firm Name])
Measure → Return of Selected Model (Model 1)
Return_Model1 =
CALCULATE(
AVERAGE('Models'[Return (%)]),
REMOVEFILTERS('Models'[Firm Name])
)
Purpose: Returns average return for Model 1, selected by slicer on Models.
Measure → Return of Comparison Model (Model 2)
VAR SelectedComparison = SELECTEDVALUE('Comparison Firm'[Firm Name])
RETURN
CALCULATE(
AVERAGE('Models'[Return (%)]),
'Models'[Firm Name] = SelectedComparison
)
Purpose: Returns average return for Model 2, chosen by slicer on Comparision Firm
Measure → Return Difference
Return_Difference = [Return_Model1] - [Return_Model2]
Purpose: Displays the difference between the two selected model returns.
Measure → Comparison Name
Comparison_Name =
VAR Model1 = SELECTEDVALUE('Models'[Firm Name])
VAR Model2 = SELECTEDVALUE('Comparison Firm'[Firm Name])
RETURN
IF(
ISBLANK(Model1) || ISBLANK(Model2),
BLANK(),
Model1 & " vs " & Model2
)
Purpose: Useful for card visuals showing what you are comparing.
Matrix Visual Setup
Columns - ReturnModel1, ReturnModel2, Return_Difference
Slicers (on the page):
-
Models - For Model 1
-
ComparisionFirm - For Model 2 (Comparison)
If the response has addressed your query, please Accept it as a solution and give a 'Kudos' so other members can easily find it.
Best Regards,
Tejaswi.
Community Support
- v-tejrama1 year agoCommunity Support
Hi Warrior42 ,
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please Accept it as a solution so that other community members can find it easily.Thank you,
Tejaswi.
- v-tejrama1 year agoCommunity Support
Hi Warrior42,
I wanted to follow up and see if you had a chance to review the information shared. If you have any further questions or need additional assistance, feel free to reach out.
If the response answered your query, kindly “Accept as Solution” and Give “Kudos” to help others in the community benefit from it as well.
Thank you
- v-tejrama1 year agoCommunity Support
Hi Warrior42 ,
I hope the information provided has been useful. Please let me know if you need further clarification or would like to continue the discussion.
If your question has been answered, please “Accept as Solution” and Give “Kudos” so others with similar issues can easily find the resolution.
Thank you.