Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
zabman
Frequent Visitor

Targetline on combochart

Hi,
I would like to have a target line on a combo chart that shows the percentage from January. I have created a DAX measure as follows:

target_line =
DIVIDE (
CALCULATE (
COUNT ( Data[File No] ),
FILTER( Data, Data[Compliant] = "Yes"),
FILTER( datetable, datetable[FYMM] = 2201)
),
CALCULATE ( COUNT ( Data[Compliant] ),
FILTER( datetable, datetable[FYMM] = 2201)
)
)
 
The result is correct, but when used as a line value, it only displays on the Jan-22 column rather than accross the entire year
2 REPLIES 2
amitchandak
Super User
Super User

@zabman , Try like

 

target_line =
DIVIDE (
CALCULATE (
COUNT ( Data[File No] ),
FILTER( Data, Data[Compliant] = "Yes"),
FILTER( all(datetable), datetable[FYMM] = 2201)
),
CALCULATE ( COUNT ( Data[Compliant] ),
FILTER( all(datetable), datetable[FYMM] = 2201)
)
)

or

target_line =
DIVIDE (
CALCULATE (
COUNT ( Data[File No] ),
FILTER( Data, Data[Compliant] = "Yes"),
FILTER( all(datetable[FYMM]), datetable[FYMM] = 2201)
),
CALCULATE ( COUNT ( Data[Compliant] ),
FILTER( all(datetable[FYMM]), datetable[FYMM] = 2201)
)
)

Hi,

I get the same result as before. The percentage is correct, but instead of showing on every month the January percentage, it only shows on January

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors