Forum Discussion
Filter Text using DAX
- Anonymous6 years ago
KevinProjectedMTDSales = CALCULATE(SUM('Report for Sales'[Projected MTD Sales_]),'Report for Sales'[Title]="KEVIN") KevinCurrentMonthBudget = CALCULATE(SUM('Report for Sales'[Current Month Budget]),'Report for Sales'[Title]="KEVIN")
Per your requirement to do it in DAX, you should probably do something along the lines of:
Measure =
VAR __table = FILTER('Table',[Title] = "Preeti")
RETURN
SUMX(__table,[Marks])
- PreetiSahu3216 years agoHelper I
Hi Greg_Deckler ,
Thanks for your reply!!
And one more thing I want to know is If I will take a text column (Basically String) instead of [Marks], then What should I use the function instead of SUMX?
Because when I am trying to enter a text column instead of marks, it is showing me an error as:
"The Function SUMX can not work with values of type String".
Please, can you suggest me what I have to do?
- Greg_Deckler6 years agoCommunity Champion
If you are returning a string, you would want to use something like MAXX or MINX instead of SUMX.
- PreetiSahu3216 years agoHelper I
Hi Greg_Deckler ,
I have another table named Report for Sales where I have to do the same requirement as the Marksheet table. In this Report for Sales table, I have to filter each person's details from the Title column. You can see the below screenshot.
Here, In this above screenshot, I have taken a slicer filter for your understanding purpose. As per my requirement, I want to show each person details. For example, When I will select "KEVIN", it will display only the details of KEVIN only.
But I want to do this thing by using Measure not by using any Filter.
Also, I have used your Measure formula as you said, but it is not working for me. And one more thing I want to say is, I want to display the measure by using the Clustered bar chart like the above screenshot.
You can view my sample report by clicking this link: Sample Report
Please, Can you suggest me what I have to do?