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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ritanoori
Resolver I
Resolver I

A measure based on two columns

Hi everyone, 

I have below fact table where it has date col with relation to my calendar table in PBI. 

PERIOD_CALC col is

PERIOD_CALC = EOMONTH('Fact_Table)'[Deal Date],0)
 
I want to create a measure where to claculate Col AMT B / (S) when Strategy col is "EHA M+1" and when PERIOD_CALC is CM. 
from my screenshot should be Mar 2020. 
It's now totalling up all the amounts when I select Mar in my date slicer. What should I change or what should be added to my measure?
Measure= CALCULATE(sum('Fact_Table'[AMT B / (S)]),'Fact_Table'[Strategy]="EHA M+1")
Noting that PBI will have historical data do when selecting Feb in date slicer, measure result should show only the amounts Feb in Period_Calc colm. 

new pic-1.PNG

 

Thanks a lot

3 REPLIES 3
AiolosZhao
Memorable Member
Memorable Member

@ritanoori ,

 

Thanks for your kudo, and have I solve your questions?

 

If yes, could you please accept my answer as the solution so other people will know the thread is solved.

 

If not, you can feel free to tell me what's your question now, and I will glad to help to solve that.

 

Thanks.

Aiolos Zhao





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




amitchandak
Super User
Super User

@ritanoori , I did not it completely. But seem like you need to join deal date or period_calc also with date table. That will create an inactive join, Which you can activate using userelation.

 

Refer how to use it : https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

 

AiolosZhao
Memorable Member
Memorable Member

Hi @ritanoori ,

 

I think your historical data must have a flag or an archive label, something like:

202002 XXX-your Feb data

202003 YYY-your Mar data

 

If yes, you can create a flag in your dataset, like:

if month(archive label) = month(period_calc) then yes else no.

 

And you can change your measure to:

Measure= CALCULATE(sum('Fact_Table'[AMT B / (S)]),'Fact_Table'[Strategy]="EHA M+1", flag = "yes")

 

Then when you select PERIOD_CAL = March, I think it will only show what you want.

 

If I'm not correct, could you please help to more clarify your question?

 

Thanks.

Aiolos Zhao





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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