Forum Discussion
KPI Visual not working properly
- Anonymous2 years ago
Hi RoHa ,
You can create a measure as below and put it on the KPI visual to replace the original one. Later check if it can return the expected result...
Total Revenue = CALCULATE( SUM('YourTable'[GL Amount]), ALLSELECTED('YourTable'[Month]) )If the above one can't help you figure out, please provide some raw data in your table (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It would be helpful to find out the solution. You can refer the following link to share the required info:
How to provide sample data in the Power BI Forum
And 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 RoHa - please use your table name only ANT-Income Statement
Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!
Hi rajendraongole1 - I've created the measure according to your code, however I'm still facing the same issues. The KPI visual shows the revenue of the last "Month Name" in the set (May) when all months are selected. Also, when I select "January" and "March", the KPI visual will show the revenue of the latest "Month Name" selected. So, in this example we will see the revenue of March in the visual. Please refer below for some screenprints, please can you help here? If you need additional information let me know!
- rajendraongole12 years agoSuper User
Hi RoHa - Ok, can you try this measure and replace Yourtable and columns correctly.
Total Revenue =
VAR SelectedMonthCount = COUNTROWS(VALUES('YourTable'[Month Name]))
RETURN
SWITCH(
TRUE(),
SelectedMonthCount = COUNTROWS(ALL('YourTable'[Month Name])),
CALCULATE(SUM('YourTable'[GL Amount]), 'YourTable'[Category] = "Revenue"),
SelectedMonthCount = 1,
CALCULATE(SUM('YourTable'[GL Amount]), 'YourTable'[Category] = "Revenue", VALUES('YourTable'[Month Name])),
SelectedMonthCount > 1,
CALCULATE(SUM('YourTable'[GL Amount]), 'YourTable'[Category] = "Revenue", 'YourTable'[Month Name] IN VALUES('YourTable'[Month Name])),
BLANK()
)Lets see.
Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!- RoHa2 years agoFrequent Visitor
Hi rajendraongole1 - unfortunately, the issue still persists in the KPI visual. It's weird because in a card visual the code is working just fine.
- Anonymous2 years agoNot applicable
Hi RoHa ,
You can create a measure as below and put it on the KPI visual to replace the original one. Later check if it can return the expected result...
Total Revenue = CALCULATE( SUM('YourTable'[GL Amount]), ALLSELECTED('YourTable'[Month]) )If the above one can't help you figure out, please provide some raw data in your table (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It would be helpful to find out the solution. You can refer the following link to share the required info:
How to provide sample data in the Power BI Forum
And 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