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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
MiraAnniina
New Member

Calculated measures

Do you know if it's possible to make such function, that shows calculated measures on rows based on months on columns? I have calculated measures on rows and calendar-hierarchy from tabular model.

 

I would like to have a function like:

 

JanuaryMeasure =  if ( month="Jan" , xxx )

FebruaryMeasure =  if ( month="Feb" , xxx )

 

I can't seem to figure this out 😕 I studied the internet and it seems that function IF works with measures, but what kind of function would work with months? 

1 ACCEPTED SOLUTION

Hi @MiraAnniina 

In addition to  

Measure = 
SWITCH(MAX('Table'[Month]),"January","xxx","February","yyy","zzz")

Calculated column:

Calculated column = 
SWITCH('Table'[Month],"January","xxx","February","yyy","zzz")

Result is as below.

Build a matrix visual and don't forget set show values in row in Format.

3.png

1.png

If you want to show result as you show above, you may need to build measures for each month.

4.png

 

Best Regards,

Rico Zhou

 

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

 

View solution in original post

5 REPLIES 5
v-rzhou-msft
Community Support
Community Support

Hi @MiraAnniina 

Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file from your Onedrive for Business.

 

Best Regards,

Rico Zhou

MiraAnniina
New Member

Hi, sorry for my poor question. I will try to be more clear. Does this example help:

 

 JanuaryFebruary
Measure 1 (on Jan)xxx 
Measure 2 (on Feb) yyy

 

Now I'm looking for a function, that would show these "xxx" and "yyy" on the report based on the month column. So I would have a measure on rows and depending on the month, it will or will not show the amount. What would my functions look like on rows Measure 1 and Measure 2?

Hi @MiraAnniina 

In addition to  

Measure = 
SWITCH(MAX('Table'[Month]),"January","xxx","February","yyy","zzz")

Calculated column:

Calculated column = 
SWITCH('Table'[Month],"January","xxx","February","yyy","zzz")

Result is as below.

Build a matrix visual and don't forget set show values in row in Format.

3.png

1.png

If you want to show result as you show above, you may need to build measures for each month.

4.png

 

Best Regards,

Rico Zhou

 

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

 

amitchandak
Super User
Super User

@MiraAnniina , In the matrix you have the option to show measure on row

"Show on row" - Switch that on and try. No row. and month on the column

 

https://www.burningsuit.co.uk/blog/2019/04/7-secrets-of-the-matrix-visual/

PhilipTreacy
Super User
Super User

Hi @MiraAnniina 

I'm not very clear about what you want to do.  Can you please provide some examples of the data and the results you want.

regards

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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