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

Shape the future of the Fabric Community! Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions. Take survey.

Reply
Syndicate_Admin
Administrator
Administrator

Marguie

I need help with a visualization in power bi, I have a table with the date and the goal defined for that month and I have a KPI visual. I have a date filter and the visual changes when I choose one month or another, but if what I choose is a day or week it appears blank, you can help me

1 ACCEPTED SOLUTION

In the end I did it instead of with a measure, with a calculated column Monthly Goal = VAR Date = My Table[Date] RETURN CALCULATE(FIRSTNONBLANK(Goals[Goal],Goals[Goal] ), FILTER(Goals, (date > Goals[Date] & date <= EOMONTH(Goals[Date], 0))))

View solution in original post

4 REPLIES 4
v-tangjie-msft
Community Support
Community Support

Hi @Syndicate_Admin ,

 

According to your description, here are my steps you can follow as a solution.

(1) This is my test data. 

vtangjiemsft_0-1708410826870.png

(2) We can create a measure. 

Flag = IF(ISFILTERED('Table'[Date].[Day])=TRUE(),0,1)

(3) Place [Flag=1] on visual object screening and then the result is as follows.

vtangjiemsft_1-1708411481881.pngvtangjiemsft_2-1708411499713.png

 

 

If the above one can't help you get the desired result, please provide some sample data in your tables (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. Thank you.

 

Best Regards,

Neeko Tang

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

In the end I did it instead of with a measure, with a calculated column Monthly Goal = VAR Date = My Table[Date] RETURN CALCULATE(FIRSTNONBLANK(Goals[Goal],Goals[Goal] ), FILTER(Goals, (date > Goals[Date] & date <= EOMONTH(Goals[Date], 0))))

Hi @Syndicate_Admin ,

 

good to hear you managed to solve the issue. I'm not sure it's the best way to solve this, but if it works for you, then by all means.

 

Be wary of circular dependencies though when using calculate in calculated columns!

Avoiding circular dependency errors in DAX - SQLBI

 

Cheers

C4YNelis
Advocate III
Advocate III

Hi @Syndicate_Admin ,

 

it's a little difficult to say for sure without seeing your data and model, however, it sounds like you have a target for the month and you are trying to show this on a different granular level from what you have modelled.

 

Basically it all depends on how you have linked your targets to your calandar table. You could have linked the month to one specific date (e.g. the first or the last date of the month), since you're trying to see targets for one day. If so, that means that selecting a random (few) different day(s) for that month, without overlapping your linked target date, will give you a blank target, since there is no matching target for that specific day.

 

Another possibility is that you explicitely modelled the monthly target as such by linking to a month (which I would not recommend), but then there is no logic in selecting just a day (since that is on a much finer granular level than your targetdefinition). Selecting a month might also total the target times the number of days in that month, unles you are using for instance a min or max function.

 

My advice would be to recalculate your target to a granular level where you have a daily target available and link that to your calandar table.

 

Hopefully this makes sense.

 

Cheers

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.