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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

IF result value exist, ignore prognosis value and only show result

I'm trying to create a matrix where a projects income and cost can have a prognosis income/cost, and the result income/cost. 

So something like this:

ProjectIDYearTypeC/IValue
12018PrognosisIncome50 000
12018ResultIncome70 000
12018PrognosisCost30 000
12018ResultCost35 000
xetc etc   
22022PrognosisIncome75 000
22022PrognosisCost75 000

 

So what I want in my matrix/measure is when there is a result, I want to display only that value, not the prognosis. And when there is only a prognosis, only show the prognosis. 

 

So for example for year 2018, i would only want to see the results of income and cost. 

And for 2022 only the prognosis for income and cost. 

 

Any tips for how to achieve this? 

Thanks

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

I believe this is the result you want.  You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

10 REPLIES 10
Ashish_Mathur
Super User
Super User

Hi,

I believe this is the result you want.  You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Thank you!

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

@Ashish_Mathur  

Another question, for some projects there is only a prognosis in earlier year, this makes them get considered in the new column. Is there a way to get them ignored instead? What do I need to adjust in the column? 

Example:

ProjectIDYearTypeC/IValueConsider/Ignore
1602009PrognosisCost12 000Ignore
1602009ResultCost12 008Consider
1602009PrognosisIncome100 000Consider

 

In example above I would like the Income prognosis to be ignored. 

Thanks!

Hi,

This logic seems inconsistent with tha of the previous years.  I cannot figure out a common logic which will apply to all rows.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

I see, thank you. 

I'm thinking something like everything earlier than todays year should be ignored, unless type = Result but didn't manage to get the formula working correctly. Then combine it with other parts for prognosis 

Anonymous
Not applicable

Hi @Anonymous ,

 

Based on my test, you could create a flag measure and then apply it to filter pane:

Flag = 
var _t=SUMMARIZE(FILTER(ALL('Table'),[ProjectID]=MAX('Table'[ProjectID]) && [Year]=MAX('Table'[Year])),'Table'[Type])
return IF( COUNTX(_t,[Type]) =1 && MAX('Table'[Type])= "Prognosis" || ("Result" in _t && MAX('Table'[Type]) ="Result") ,1)

Output:

Eyelyn9_1-1639017140380.png

 

 

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

Anonymous
Not applicable

@Anonymous Thanks!

Unfortunately for some reason it didn't appear to work for me. Maybe because the model got updated shortly after this post and I now have another "type",  budget as well. So Budget, Prognosis and Result. 

 

Anyway, with this measure in place, I can in some places still see both prognosis and results for previous years. 

amitchandak
Super User
Super User

@Anonymous , Based on what I got so far, You need to create a new column  like

new column =

var _cnt1= countx(filter(Table, [Year] =earlier([year]) ) , [Type]) +0

var _cnt2= countx(filter(Table, [Year] =earlier([year]) && [Type] ="Prognosis" ) , [Type]) +0

return

if(_cnt1=_cnt2 , "Prognosis", [C/I])

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak 

Thanks for the reply!

Sadly this didn't seem to work, unless I did something wrong. 

I still see the same results, meaning I can still see that some years show both Prognosis and Results

 

Edit: I tried making a column that checks if the year is before 2021, and if so sets value to "Result", else "Prognosis": 

IF(financial[year]<2021-01-01, "Result", "Prognosis")

But something with this isn't quite right, since all values in the column end up being "Prognosis" 

I then wanted to use this as a way to get the values into the matrix, but I get an error saying

"A function 'CONTAINSROW' has been used in a True/False expression that is used as a table filter expression. This is not allowed."

if(financial[NewColumn]= "Result", CALCULATE(SUM(financial[value]), financial[value] IN {financial[type] = "Result"}), CALCULATE(SUM(financial[value]),financial[value] IN {financial[type] = "Prognosis"}))

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors