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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
ad_nan
Regular Visitor

dimension in calculated measure

Hi,

 

Can we use dimension in calculated measures?

 

Also while creating a cal. measure i got an error : 

 

A single value for column 'dimension_name' in table 'table_name' cannot be determined.
This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result.

 

Can anyone help?

 

Thanks,

1 ACCEPTED SOLUTION

According to the error that you are getting and that you are doing this in a measure, then you need to use an aggregator like:

 

Measure = if(MAX('table'[dim_name]) = "dim1",((if(MAX('table'[dim_name]) = "dim2",'table'[measure]))/(if(MAX('table'[dim_name]) = "dim3",'table'[measure])))/12,5)

Follow on LinkedIn
@ 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...

View solution in original post

6 REPLIES 6
Ivric
Frequent Visitor

I'm trying to do some calcualtion by creating a new Measure in a dimension named Programs on power bi desktop

if 'Programs'[StartDate] is blank then pick 'Programs'[AltDate] else pick 'Programs'[StartDate] 

 

but in the measure i created under Programs I could access the date columns in my DAX.

 

I'm connecting power bi live to ssas tabular cube.

 

 

Thanks,

Ivric
Frequent Visitor

I'm trying to do some calcualtion by creating a new Measure in a dimension named Programs on power bi desktop

if 'Programs'[StartDate] is blank then pick 'Programs'[AltDate] else pick 'Programs'[StartDate] 

 

but in the measure i created under Programs I could access the date columns in my DAX.

 

I'm connecting power bi live to ssas tabular cube.

 

 

Thanks,

Greg_Deckler
Super User
Super User

Yes you can but you have to follow DAX syntax. Can you post your formula and sample data and what you are trying to accomplish?


Follow on LinkedIn
@ 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...

@Greg_Deckler

Thanks for quick response.

 

I am trying to implement something similar to this:

 

if('table'[dim_name] = "dim1",((if('table'[dim_name] = "dim2",'table'[measure]))/(if('table'[dim_name] = "dim3",'table'[measure])))/12,5)

 

'/' does not work here. 

 

Thanks.

Hi @ad_nan,

 

Have you tried the measure provided by @Greg_Deckler above? Does it work in your scenario? If it works, could you accept it as solution to close this thread?

 

If you still have any question on this issue, feel free to post here. Smiley Happy

 

Regards

According to the error that you are getting and that you are doing this in a measure, then you need to use an aggregator like:

 

Measure = if(MAX('table'[dim_name]) = "dim1",((if(MAX('table'[dim_name]) = "dim2",'table'[measure]))/(if(MAX('table'[dim_name]) = "dim3",'table'[measure])))/12,5)

Follow on LinkedIn
@ 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...

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.