Forum Discussion
Help with Flag Column
- 3 years ago
Hi,
For this you need to create a disconnected table with the filter to be used in this case Y/N.
The create the following measure:
Flag_MEasure_filter = IF([P FLag Measure] in DISTINCT('Flag Filter'[Flag filter]), 1)Use this measure to filter the table and the column of the disconnected table to use has slicer result below and in attach file:
Thanks MFelix for the update.
The data is same with simple date table joined on datekey similar to below
Table1
| P_Code | C_Code | Amt | Datekey |
| 8G1 | 318 | 60 | 20221115 |
| 8G1 | 458 | 30 | 20221115 |
| 8G1 | 314 | 80 | 20221115 |
| G54 | 750 | 40 | 20221115 |
| G54 | 547 | 20 | 20221115 |
| G54 | 458 | 50 | 20221115 |
| TY7 | 159 | 10 | 20221115 |
| 8G1 | 458 | 30 | 20221114 |
| 8G1 | 314 | 80 | 20221114 |
| G54 | 750 | 40 | 20221114 |
| G54 | 547 | 20 | 20221114 |
| G54 | 458 | 50 | 20221114 |
| TY7 | 159 | 10 | 20221114 |
Table2
| C_Code | Flag |
| 318 | Y |
| 458 | N |
| 314 | N |
| 750 | N |
| 547 | N |
| 159 | Y |
Date
| Datekey | Calendar date |
| 20221115 | 11/15/2022 |
| 20221114 | 11/14/2022 |
Relatioship
Similar to column I created a measure as below which is working fine with dates
But again the problem is the C_Flag column selection creates problem
Please see below picture when I select Flag as N the P_Flag_Measure is not worknig fine
C_codes 314 and 458 should show Y but its changing.
In the above image its showing Y and after Flag selection its showing N as below image
Please share you inputs. Thank you
Hi,
For this you need to create a disconnected table with the filter to be used in this case Y/N.
The create the following measure:
Flag_MEasure_filter = IF([P FLag Measure] in DISTINCT('Flag Filter'[Flag filter]), 1)
Use this measure to filter the table and the column of the disconnected table to use has slicer result below and in attach file:
- Anonymous3 years agoNot applicable
Hi MFelix ,
Sorry if I confused the main criteria is to use both flags child Flag and
Parent Flag ( new column or measure created)
user needs both Flags for slicer selection.When we select both Flags to Y its good but when we select N in both Flags we should see only 3 C_codes but we are getting 5 C_codes
As the criteria is we assign Y to complete parent even one child code has Y in child flag which is in Table2 since 8G1 has one C_code with Child Flag as Y we assign whole parent Flag Y
When we select both Flags N we expect only G54 to be displayed as it is not having even one c_code with Y in Child Flagplease see the image below we don't expect the highlighted once when both Flags are set to N.
please suggest if this is fesiable.
Thank you so much for all your help.
- MFelix3 years agoSuper User
Hi Anonymous ,
Clarify me please about the objective of getting the flag slicer, I understood that you want to filter the flag measure by the Y/N meaning that if you select Y the result based on your first image would be:
His my perception correct? If this is correct then you only need to use the new table has a slicer on the page since the new metric compares the selection of the slicer to the result of the metric.
- Anonymous3 years agoNot applicable
You are absolutely right MFelix everything works fine when individually selected until users are selecting both flags in combination
Ex:
Select N from Flag column in Table2 and Y from new Table then we expect to see P_code 8G1 and C_Codes 314 and 458
Select N from Flag column in Table2 and N from new Table then we expect to see P_code G54 and C_Codes 458,547 and 750I see the measure is changing when we select Flag N from Table2 seems like the measure is considering that particular subset of data and assigning N for
C_Codes 314 and 458
may be adding allexcept on the 'Table (2)'[Flag] in the "P FLag Measure" might helpsorry however not sure how to add it 😊