Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.
Hi everyone,
I need some help to create a DAX measure that I can adjust the scale when drilling up and down on a dual axis chart. The bars and row of chart (y axis and y secundary axis) need to have the same measure as a scale. The chart drill up and down from year to day. See the example below:
When I drill down to the day visual, I need that my scale (of both y axis) goes 0 to 24 (number of hours of day) * [Measure].
When I drill up to the month visual, I need that my scale goes 0 to 744 (maximum number of hours of a month) * [Measure]
And when I drill up to the year visual I need that my scale goes 0 to 8760 (number of hours of a year) * [Measure]
I'm trying this measure but it is not working:
Scale of chart =
// var vPotenciaInstalada = [Measure]
var vRows = CALCULATE(COUNTROWS(VALUES('Calendar'[Date])))
var vHours = SWITCH(
TRUE(),
vRows < 32, 24, // Context of DAY, scale goes 0 to 24 * [Measure]
vRows > 31 || vRows < 367, 744, // Context of MONTH, scale goes 0 to 744 * [Measure]
8760 // Context of YEAR, scale goes 0 to 8760 * [Measure]
)
var vLimiteSuperior = vHours
var vCalculo = SWITCH (
TRUE (),
ISFILTERED('Calendar'[Day]), vLimiteSuperior,
ISFILTERED('Calendar'[Month]), vLimiteSuperior,
ISFILTERED('Calendar'[Year]), vLimiteSuperior,
BLANK ()
)
return
vCalculo
I can't attached files here so I'm sharing this link on Google Drive with the pbix file.
Any ideas of how to do this?
Appreciate all of your help,
Regards
User | Count |
---|---|
11 | |
9 | |
6 | |
5 | |
4 |