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 - create a dax measue to calculate the total revenue based on the selected months. it should dynamically adjust its calculation based on the number of months selected in the slicer.
Total Revenue =
VAR SelectedMonths = SELECTEDVALUE('Table'[Month Name])
RETURN
SWITCH(
TRUE(),
ISINSCOPE('ANT-Income Statement'[Month Name]),
SUMX(
'Table',
IF('ANT-Income Statement'[Category] = "Revenue", 'ANT-Income Statement'[GL Amount], 0)
),
HASONEVALUE('ANT-Income Statement'[Month Name]),
CALCULATE(
SUM('ANT-Income Statement'[GL Amount]),
'ANT-Income Statement'[Category] = "Revenue",
'ANT-Income Statement'[Month Name] = SelectedMonths
),
CALCULATE(
SUM('ANT-Income Statement'[GL Amount]),
'ANT-Income Statement'[Category] = "Revenue",
'ANT-Income Statement'[Month Name] IN VALUES('ANT-Income Statement'[Month Name])
)
)
Modify the table name and columns as per your table, and add total revenue measure to indicator of kpi visual and add a slicer visual to month name.
Hope it works . Check it
Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!