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.
Hello all, I have the below data
Region | Zone | Amount |
IN | A | 1 |
IN | B | 2 |
TR | A | 3 |
SR | A | 4 |
SR | B | 5 |
SR | C | 6 |
When i add this in bar chart i get the below. Now the requirement is if i turn on the drill down and click on Region SR it should show A,B,C as differnt zones and the total of it.
@amitchandak @parry2k please help
Solved! Go to Solution.
Hi @harshagraj ,
Add a table with the zones and one addtional row with the Total I used the following syntax:
Zones Table = UNION(DISTINCT('Table'[Zone]),ROW("Total", "Total"))
Create an inactive relationship between the zone table and the fact table.
Now create the following measure:
Zones + Total =
IF (
SELECTEDVALUE ( 'Zones Table'[Zone] ) = "Total",
COUNT ( 'Table'[Sub] ),
CALCULATE (
COUNT ( 'Table'[Sub] ),
USERELATIONSHIP ( 'Zones Table'[Zone], 'Table'[Zone] )
)
)
Use the Zone of the new table on the drill trough result below:
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @harshagraj ,
For this you need to change the syntax of the new table and the meausre:
Zones Table =
UNION (
ADDCOLUMNS ( DISTINCT ( 'Table'[Zone] ), "Type", "Zone" ),
ADDCOLUMNS ( DISTINCT ( 'Table'[Region] ), "Type", "Region" )
)
Create inactive relationship between zone and region (you will have two inactive relationshiops)
Change the measure to:
Zones + Total =
IF (
SELECTEDVALUE( 'Zones Table'[Type] ) = "Region",
CALCULATE (
COUNT ( 'Table'[Sub] ),
USERELATIONSHIP ( 'Zones Table'[Zone], 'Table'[Region] )
)
,
CALCULATE (
COUNT ( 'Table'[Sub] ),
USERELATIONSHIP ( 'Zones Table'[Zone], 'Table'[Zone] )
)
)
Result below and attached.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em Português@harshagraj , if want to move end of the axis to show till 15, You need to create a measure
Use a measure in END limit of y axis - measure like calculate(sum(Table[Amount]), allselected(zone) )
there is fx option
Hi @amitchandak I have attached the pbix file.
https://drive.google.com/file/d/1vKOylrxfEHxTLVpPkhhspp7PeqfSmykH/view?usp=sharing
When i right click and drillthrough on region i am getting total+other zones.
I just need total and zones which are related to that region selected.
Hi @harshagraj ,
Add a table with the zones and one addtional row with the Total I used the following syntax:
Zones Table = UNION(DISTINCT('Table'[Zone]),ROW("Total", "Total"))
Create an inactive relationship between the zone table and the fact table.
Now create the following measure:
Zones + Total =
IF (
SELECTEDVALUE ( 'Zones Table'[Zone] ) = "Total",
COUNT ( 'Table'[Sub] ),
CALCULATE (
COUNT ( 'Table'[Sub] ),
USERELATIONSHIP ( 'Zones Table'[Zone], 'Table'[Zone] )
)
)
Use the Zone of the new table on the drill trough result below:
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsThanks a lot this is perfect @MFelix just a small question instead of making it as Total can i actually display the region name itself which i clicked in drillthrough?
Hi @harshagraj ,
For this you need to change the syntax of the new table and the meausre:
Zones Table =
UNION (
ADDCOLUMNS ( DISTINCT ( 'Table'[Zone] ), "Type", "Zone" ),
ADDCOLUMNS ( DISTINCT ( 'Table'[Region] ), "Type", "Region" )
)
Create inactive relationship between zone and region (you will have two inactive relationshiops)
Change the measure to:
Zones + Total =
IF (
SELECTEDVALUE( 'Zones Table'[Type] ) = "Region",
CALCULATE (
COUNT ( 'Table'[Sub] ),
USERELATIONSHIP ( 'Zones Table'[Zone], 'Table'[Region] )
)
,
CALCULATE (
COUNT ( 'Table'[Sub] ),
USERELATIONSHIP ( 'Zones Table'[Zone], 'Table'[Zone] )
)
)
Result below and attached.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsCovering 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 |
---|---|
112 | |
100 | |
80 | |
64 | |
57 |
User | Count |
---|---|
145 | |
111 | |
92 | |
84 | |
66 |