March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe 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
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?
Solved! Go to Solution.
Hi @MiraAnniina
In addition to amitchandak ‘s reply, if you want to show result "xxx" or "yyy" based on the month column, you just need to build one measure/ calculated column to achieve your goal.
Try if or switch function.
Measure:
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.
If you want to show result as you show above, you may need to build measures for each month.
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.
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
Hi, sorry for my poor question. I will try to be more clear. Does this example help:
January | February | |
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 amitchandak ‘s reply, if you want to show result "xxx" or "yyy" based on the month column, you just need to build one measure/ calculated column to achieve your goal.
Try if or switch function.
Measure:
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.
If you want to show result as you show above, you may need to build measures for each month.
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.
@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/
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
Proud to be a Super User!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
134 | |
91 | |
89 | |
64 | |
58 |
User | Count |
---|---|
201 | |
137 | |
107 | |
72 | |
68 |