Forum Discussion
DISTINCTCOUNT Measure in visualization
- 5 years ago
Hi Saxon10 ,
What you can do is to do a summarization with the calculation of the colours. For this what I have done is to create two other tables (in order to have the dynamic part of the filtering if you need).
Colour
Orange Green Formatting_Measure ID
Fruit List 1 Area Code 2 Language 3 Sales Code 4 Now add the following measure:
Count of Formats = VAR MEASURE_SELECTION = SWITCH ( SELECTEDVALUE ( Formatting[ID] ); 1; COUNTROWS ( FILTER ( SUMMARIZE ( ALLSELECTED ( REPORT[ITEM] ); REPORT[ITEM]; "Format"; [FORMATTING FRUITLIST] ); [Format] = MAX ( Colours[Colour] ) ) ); 2; COUNTROWS ( FILTER ( SUMMARIZE ( ALLSELECTED ( REPORT[ITEM] ); REPORT[ITEM]; "Format"; [FORMATTING AREACODE] ); [Format] = MAX ( Colours[Colour] ) ) ); 3; COUNTROWS ( FILTER ( SUMMARIZE ( ALLSELECTED ( REPORT[ITEM] ); REPORT[ITEM]; "Format"; [FORMATTING LANGUAGE] ); [Format] = MAX ( Colours[Colour] ) ) ); 4; COUNTROWS ( FILTER ( SUMMARIZE ( ALLSELECTED ( REPORT[ITEM] ); REPORT[ITEM]; "Format"; [FORMATTING SALESCODE] ); [Format] = MAX ( Colours[Colour] ) ) ) ) RETURN MEASURE_SELECTIONSee result below and in attach PBIX file:
What's your reason for not linking the Data and Report tables via the ID column (the composite key)? Using LOOKUPVALUE() is not really encouraged. I assume this is something you did in Excel first?
No I didn't make any data in Excel. The way I matched inbetween two tables, You can see the conditional formating measure and conditional formating comments measure on the file.The data table more general but the report table on item level that the reason you unable to find the link in between.