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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
rpinxt
Solution Sage
Solution Sage

Showing the Year amount in a graph (column and line) for every month the same year amount

This is the data I bring in :

rpinxt_0-1698676706746.png

the number 1944 I want to show in all periods of 2022.

I made this measure :

rpinxt_1-1698677100221.png

 

Now for easier vieuwing I put what I want in a table:

rpinxt_2-1698677161593.png

So these are the periods (2022 and 2023) and are on the x-axis of a column/line chart.

With colums with other amounts etc.

Now I want to bring a line in with the amount 1944 on all the periods and in 2023 the amount is 1920.

But as soon as I bring in measure UCL this happens:

rpinxt_3-1698677303729.png

It only puts in 12-2022 because the source only had 1 period. It was only the year I made it 12-xxxx everywhere hoping that would help.

 

So is there a way with a measure that for every period of a year it shows the same amount?

3 ACCEPTED SOLUTIONS
Ritaf1983
Super User
Super User

Hi  @rpinxt
You can use Dax measure like :
profit_all_year =
CALCULATE (
    [your measure] ),
    ALL ( your_table[Month_year] ),
    YEAR ( 'your_table'[Date] )
        CONVERT ( RIGHT ( ( SELECTEDVALUE ( 'your_table'[Month_year] ) )4 )INTEGER )
)

Pbix with example is attached

Ritaf1983_0-1698726932386.png

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

Hello, @rpinxt!

I'd be happy to help. The DAX logic can be a bit challenging to explain completely, but I'll do my best.

The key idea is that there are two filters involved: one to be ignored and another to be applied.

Imagine DAX as a set of instructions for a robot. In the first step, I instructed the 'robot' to completely disregard the period filter, which can be translated as 'all' in its language.

After that, I needed the 'robot' to focus on extracting the year from the column, so I added the second filter condition.

I hope this explanation helps clarify things for you 😊

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

 

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

Yep.

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

6 REPLIES 6
Ritaf1983
Super User
Super User

Hi  @rpinxt
You can use Dax measure like :
profit_all_year =
CALCULATE (
    [your measure] ),
    ALL ( your_table[Month_year] ),
    YEAR ( 'your_table'[Date] )
        CONVERT ( RIGHT ( ( SELECTEDVALUE ( 'your_table'[Month_year] ) )4 )INTEGER )
)

Pbix with example is attached

Ritaf1983_0-1698726932386.png

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Hi @Ritaf1983 ,

 

As said this solution worked beautiful.

Now however the uses added something new.

On a country level there could be month that there where no complaints.

The visuals filters these months out but user wants to see them.

No problem to switch them on, however this disturbs this solution apparently:

rpinxt_0-1701871105343.png

Is there a workaround for this?

Well.....this is excellent....😲 @Ritaf1983 

rpinxt_0-1698747076136.png

 

Really works also perfectly in the column/line chart.

Getting a sort of "trend" line horizontal that we needed.

Very pleased.

 

Althought I have no idea why this is working.

Because I already tried with the second filter, ALL, but that did not work (my first filter was ShipGrp must be Complaint Groups).

 

So guessing all the magic happens in the third filter with year and converting it somehow.

Would you be able to explain to my why this works?

Hello, @rpinxt!

I'd be happy to help. The DAX logic can be a bit challenging to explain completely, but I'll do my best.

The key idea is that there are two filters involved: one to be ignored and another to be applied.

Imagine DAX as a set of instructions for a robot. In the first step, I instructed the 'robot' to completely disregard the period filter, which can be translated as 'all' in its language.

After that, I needed the 'robot' to focus on extracting the year from the column, so I added the second filter condition.

I hope this explanation helps clarify things for you 😊

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

 

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Ok I think that made sense for me.

So first you tell to disregard the period and then you tell to filter the amount per year?
And therefore it gives on all the periods the year amount?

Yep.

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors