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
Anton-G
Helper I
Helper I

Add multiple values in measure

Need to create a measure to get a fixed limit value (red line) in a line and stacked column chart.

Have week number that I need to create a relationship to.

Connects to SQL Server Analysis Services Database.

 

Suggestions for DAX question?

 

Attach an image to illustrate what I'm trying to create.limit value (red line) in a line and stacked column chart.png

8 REPLIES 8
Greg_Deckler
Super User
Super User

Perhaps give us a hint on how to calculate Limit?

 

Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Forget the word "fixed" value has updated the original question.

Here's a more clarification of what I'm looking for.

 

Have week number
Have Counts
Need to add limit, limit is a fixed value that will always be the same between years. I think I need to create a dax to add it, to get it before, I've used "red = 5" but do not know how to get a variation.

 

WeekLimitCounts
152
253
351
454
555
652
753
852
953
10106
11108
121011
13108
14107
15106
1652
1753
1851
1953
2052

Hi @Anton-G,

 

For one year only has one week and the week is unique in the X-axis, I would suggest you add the column in the Values and take the average of them.

Add_multiple_values_in_measure

 

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Because I connect to a SQL Server Analysis Services Database I do not have the ability to add a column.

Hi @Anton-G,

 

Is it a live connection?

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Yes

 

Screenshot that shows what I can add.

Screenshot that shows what I can add.png

Hi @Anton-G,

 

Since you can add measures, you can try it like below then add it in the line.

Measure =
IF (
    MIN ( 'Date'[Week Number of Year] ) <= 9,
    5,
    IF ( MIN ( 'Date'[Week Number of Year] ) <= 15, 10, 5 )
)

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Have tried some variations of the question.

Receiving an error when I try.

 

My question:
Measure =
IF (
    MIN ( 'DIM-Calendar'[Week] ) <= 9,
    5,
    IF ( MIN ( 'DIM-Calendar'[Week] ) <= 15, 10, 5 )
)

 

Error:
Week_Error.png

 

A table showing week numbers from the same place I use in the question.

Year_Week_Table.png

 

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.