Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
- Issue in highlighting the difference of two tables in matrix visual via measure in conditional formatting
I have 2 tables; Raw and Source - both the table have same columns Business unit, Table names and Record.
In matrix visual I have the row hierarchy level as first business unit and then tables names and values of matrix is record count.
Raw data:
Business unit | Table names | Record Count |
LONDON | LONDON EYE | 123 |
LONDON | SEA SIDE | 344 |
LONDON | LONDON BRIDGE | 555 |
LONDON | TOWER BRIDGE | 359 |
USA | NEW YORK | 9087 |
USA | LOS ANGELES | 868 |
USA | CALIFORNIA | 3849 |
USA | DALLAS | 276 |
Source data:
Business unit | Table names | Record Count |
LONDON | LONDON EYE | 123 |
LONDON | SEA SIDE | 344 |
LONDON | LONDON BRIDGE | 850 |
LONDON | TOWER BRIDGE | 359 |
USA | NEW YORK | 9087 |
USA | LOS ANGELES | 868 |
USA | CALIFORNIA | 5468 |
USA | DALLAS | 276 |
I want to highlight the table names and business unit, if any of the matches the table names and bussiness unit check the record count from if the source data - record count is greater than raw table record count, then highlight the record counts values in matrix in source table.
Here I have kept as table format, but in Power BI Desktop I am using it as matrix.
In above reference table I have highlighted the text, but I want to highlight the background cells in matrix visual via measure conditional formatting.
What I am looking for is if there is mismatch of the record count for each table name and business unit or the record count(source data) is greater than the other table(raw data), In my matrix visual i want to highlight the record count values in the source table
For reference I am attaching the measure which I am using.
HighlightDifference_Counts =
VAR CurrentBusinessUnit = SELECTEDVALUE('DB_SRC SRC_TBL_STATS'[BUSINESS_UNIT])
VAR CurrentFileName = SELECTEDVALUE('DB_SRC SRC_TBL_STATS'[SRC_TABLE_NAME])
VAR SrcTableCount = COUNTROWS(
FILTER(
'DB_RAW RAW_TBL_STATS_V_for_SRC',
'DB_RAW RAW_TBL_STATS_V_for_SRC'[TABLE_NAME] = CurrentFileName &&
'DB_RAW RAW_TBL_STATS_V_for_SRC'[BUSINESS_UNIT] = CurrentBusinessUnit
)
)
VAR RawTableCount = COUNTROWS(
FILTER(
'DB_SRC SRC_TBL_STATS',
'DB_SRC SRC_TBL_STATS'[SRC_TABLE_NAME] = CurrentFileName &&
'DB_SRC SRC_TBL_STATS'[BUSINESS_UNIT] = CurrentBusinessUnit
)
)
RETURN
IF (
ISINSCOPE('DB_SRC SRC_TBL_STATS'[SRC_TABLE_NAME]), -- Check if the current scope is at the table level
IF (
NOT (SrcTableCount > RawTableCount),
1, -- Highlight the difference at the table level
0 -- Do not highlight
),
0 -- Do not highlight at the business unit level
)
Using this measure In my Power BI Desktop all the record count values are getting highlight, if the record counts are matching then to it is showing the highlight color.
Hi @JyotiChiluka ,
Based on the sample and description you provided, you might consider creating a relationship between the two tables.
Then please try code as below to create a Measure.
Measure = IF(SELECTEDVALUE(Source[Record Count]) > SELECTEDVALUE(Raw[Record Count]),1,0)
Result is as below.
Is this the result you expect?
Please correct me if I misunderstood your needs.
Best Regards,
Yulia Yan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.