Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
I would like to have a card next to a graph visualizing sales performance and Target, showing the ratio to Target for the month selected by the slicer.
I would also like to set a threshold value and have it configured to change the background of the card depending on the value.
I created the following code, but when I put it in the card, it is blank and I cannot set the color.
Is it possible to have the numbers on the table appear on the card?
Please help again.
VS Target = IF(MAX('Calendar'[Date]) = MAX('Date for slicer'[Date]), DIVIDE(SUM('Budget Control'[Actual]),SUM('Budget Control'[Target])))
I have a sample pbix file and tried to upload here, but coudn't due to the follwing error message.
error message:The file type (.pbix) is not supported.
What is wrong?
Solved! Go to Solution.
does this work?
VS Target = VAR _date=VALUES('Date for slicer'[Date]) RETURN CALCULATE(DIVIDE(SUM('Budget Control'[Actual]),SUM('Budget Control'[Target])),TREATAS(_date,'Calendar'[Date]))
because in the card visual, there is no filter context on the calendar table, so the condition of IF is FALSE, and give you a blank.
VS Target = VAR _date=MAX('Date for slicer'[Date]) RETURN CALCULATE(DIVIDE(SUM('Budget Control'[Actual]),SUM('Budget Control'[Target])),'Calendar'[Date]=_date)
Thank you for your reply.
I copied the dax code, but it is still blank.
does this work?
VS Target = VAR _date=VALUES('Date for slicer'[Date]) RETURN CALCULATE(DIVIDE(SUM('Budget Control'[Actual]),SUM('Budget Control'[Target])),TREATAS(_date,'Calendar'[Date]))
Yes!! It works!!!
Thank you very much.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
19 | |
14 | |
14 | |
11 | |
8 |