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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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/

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

November Carousel

Fabric Community Update - November 2024

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

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.