Forum Discussion
Syndicate_Admin
Administrator
4 years agojoining tables or measures
Comrades good day: I have a problem with a result that I have not been able to obtain. I have two tables with shops and cities. The first table is where the stores make a presence with sales ...
- 4 years ago
Let's see if this works for you.
First create dimension tables for Stores and Cities. The model looks like this:
And it creates the following measures:
For the number of physical stores
Tiendas Físicas = DISTINCTCOUNT('Listado de Tiendas'[Ciudad])For the number of cities with presences
Ciudades con Ventas = DISTINCTCOUNT('Ventas'[Ciudad])And for the total calculation
Total = VAR FT = VALUES ( 'Listado de Tiendas'[Ciudad] ) VAR CV = VALUES ( Ventas[Ciudad] ) RETURN COUNTROWS ( DISTINCT ( UNION ( FT, CV ) ) )I attach the sample PBIX file
Syndicate_Admin
Administrator
4 years agoLet's see if this works for you.
First create dimension tables for Stores and Cities. The model looks like this:
And it creates the following measures:
For the number of physical stores
Tiendas Físicas =
DISTINCTCOUNT('Listado de Tiendas'[Ciudad])
For the number of cities with presences
Ciudades con Ventas =
DISTINCTCOUNT('Ventas'[Ciudad])
And for the total calculation
Total =
VAR FT =
VALUES ( 'Listado de Tiendas'[Ciudad] )
VAR CV =
VALUES ( Ventas[Ciudad] )
RETURN
COUNTROWS ( DISTINCT ( UNION ( FT, CV ) ) )
I attach the sample PBIX file
v-zhangti
Community Support
4 years ago