The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
I have an interesting problem. I need to base a calculation on the date level (see example below) but have been unable to get the correct results. I would like to use a single calculation but have it change based on the date hierarchy level.
Monthly
Divide(A + ( (B+C) * 12), A)
Quarterly
Divide(A + ( (B+C) * 4), A)
Yearly
Divide(A + ( B+C) , A)
Solved! Go to Solution.
Hi @gjohnston2 ,
You can create a measure as below to get it:
Measure =
VAR _value =
IF (
ISINSCOPE ( 'Date'[Date].[Year] )
&& NOT ( ISINSCOPE ( 'Date'[Date].[Quarter] ) ),
1,
IF (
ISINSCOPE ( 'Date'[Date].[Quarter] )
&& NOT ( ISINSCOPE ( 'Date'[Date].[Month] ) ),
4,
12
)
)
RETURN
DIVIDE ( A + ( ( B + C ) * _value ), A )
If the above one is not your expected result, please provide more raw data in your table MP921000 (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards
Hi @gjohnston2 ,
You can create a measure as below to get it:
Measure =
VAR _value =
IF (
ISINSCOPE ( 'Date'[Date].[Year] )
&& NOT ( ISINSCOPE ( 'Date'[Date].[Quarter] ) ),
1,
IF (
ISINSCOPE ( 'Date'[Date].[Quarter] )
&& NOT ( ISINSCOPE ( 'Date'[Date].[Month] ) ),
4,
12
)
)
RETURN
DIVIDE ( A + ( ( B + C ) * _value ), A )
If the above one is not your expected result, please provide more raw data in your table MP921000 (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards
That was exactly what I needed - thx!!
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
82 | |
65 | |
53 | |
52 |
User | Count |
---|---|
128 | |
115 | |
80 | |
65 | |
63 |