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.
So basically the measure will return different values based on whatever is currently selected at the slicer and it will only be counted if it meets the Identifier condition, anything else that does not meet it will be ignored and not counted.
Count =
VAR CurrentStatus = SELECTEDVALUE('Show Options'[Option])
VAR Identifier = Table1[Checker]
if CurrentStatus = "Difference" && Identifier == 0 then count only the rows that meet the Identifier condition
else if CurrrentStatus = "Common" && Identifier == 1 then count only the rows that meet the Identifier condition
else if CurrentStatus - "All" then count all the rows
RETURN Whatever has been counted
Hi @Anonymous
I don't quite understand your description .
If select “Difference”, comparing these two tables, there are only three differences between them, that is, the three rows where the Customer Code is empty, so the count of the two tables should be 3.
Conversely, if you choose “Common”, then the counts of the two tables should both be 9, because they have 9 the same, so what is your calculation logic ?
Best Regard
Community Support Team _ Ailsa Tao
I would be basing the Customer Code count on the Venue Code, so there are two venues which is Laguna and Bahamas. Laguna has 9 customer code count in table1 while it only has 6 customer code count in table2 (3 rows that are not matching), that is why if I select "Difference" only the customer code count of each Laguna from their respective tables will be counted since the Laguna from the two tables have differences, that is why the card visual for table1 should show 9 while the card visual for table2 should show 6. Meanwhile Bahamas in table1 has 3 customer code count and likewise the same in table2 (all 3 rows are matching), that is why it is the only thing that will be chosen when selecting "Common"
@Anonymous , Not very Clear
a new measure
Count =
VAR CurrentStatus = SELECTEDVALUE('Show Options'[Option])
VAR Identifier = Table1[Checker]
return
Switch( true() ,
"difference" , countrows(filter(Table1, Identifier =0)) ,
"Common" , countrows(filter(Table1, Identifier =1)) ,
"All", countrows(Table1)
)
I'm very sorry, I realised the question wasn't clear enough. Let me just revise it completely. I have two tables which I want to compare.
Table1
Venue Code | Venue Name | Customer Code |
Laguna | Suria | 101Suria |
Laguna | Suria | 102Suria |
Laguna | Suria | 103Suria |
Laguna | Suria | 104Suria |
Laguna | Suria | GENSURIA |
Laguna | Suria | GENSURIA |
Laguna | Suria | 105Suria |
Laguna | Suria | 106Suria |
Laguna | Suria | 107Suria |
Bahamas | Sunway | Bah123 |
Bahamas | Sunway | Bah124 |
Bahamas | Sunway | Bah125 |
Table2
Venue Code | Venue Name | Customer Code |
Laguna | Suria | 101Suria |
Laguna | Suria | 102Suria |
Laguna | Suria | 103Suria |
Laguna | Suria | 104Suria |
Laguna | Suria | GENSURIA |
Laguna | Suria | GENSURIA |
Laguna | Suria | |
Laguna | Suria | |
Laguna | Suria | |
Bahamas | Sunway | Bah123 |
Bahamas | Sunway | Bah124 |
Bahamas | Sunway | Bah125 |
So now I will have two card visuals which will display the count of customer code for each of the tables. If the slicer is selected at "All" then the card visual for table 1 will show 12 while the card visual for table 2 will show 9. If "Difference" is selected at the slicer then the card visual for table 1 should show 9 while card visual for table 2 will show 6. If "Common" is selected at the slicer then the card visual for table 1 should show only 3 while the card visual for table 2 will only show 3 as well (because Bahamas is the only common one).
How can I achieve that using a measure that will be directly put at the card visual?
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 |
---|---|
110 | |
94 | |
80 | |
67 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |