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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
tim10
Helper I
Helper I

Measure only works if argument is included in table

Hello

 

I have a measure with this code:

 

CY-0 InnNS NEW =
var selection=SELECTEDVALUE('Year Filter Table'[Year Filter])
var option1=calculate([_CY_0_InnNS],FILTER('ION_ByProject_2020_2021', OR (Year('ION_ByProject_2020_2021'[Period])=2021 && selection=2021, Year('ION_ByProject_2020_2021'[Period])=2020 && selection=2020)))

var option2=calculate([_CY_1_InnNS],FILTER('ION_ByProject_2020_2021', (Year('ION_ByProject_2020_2021'[Period])=2020 && selection=2020)))
return
option1+option2

 

If i put this in a table, it only works if column Period is included. 

 

01.png

If i remove the period column, the table displays nothing. 

 

02.png

 

Is there a way to fix this? Basically i do not want the period column in the table, just Project Name and the Measure.

 

Thank you

1 ACCEPTED SOLUTION

Try adding the all function to see if it works:

FILTER(ALL('ION_ByProject_2020_2021'),XXXXXXXXXXXXXXXXXX

View solution in original post

4 REPLIES 4
V-lianl-msft
Community Support
Community Support

Hi @tim10 ,

 

Unfortunately,not clear about your model. Any chance you can share a PBIX file with dummy data?

Please remove any sensitive data before uploading.

https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-... 

 

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

 

Hello, Thank you for your reply. I will not be able to provide sample data unfortunately. 

Try adding the all function to see if it works:

FILTER(ALL('ION_ByProject_2020_2021'),XXXXXXXXXXXXXXXXXX

this appears to solve my issue. thank you for your support

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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