Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
Hi all,
I would like to present you with the following case. I have a simple table in Power BI Desktop, with three columns (Scope, Main and Value) as shown below.
I have also created a measure called “Duration” with the following syntax.
The above table and measure enable me to create the following matrix on the reporting canvas.
The first requirement is the show Duration in different formats. Not only do I want to show Duration in days (default format in this example) but also in hours, minutes and seconds. To do this I have created a calculation group called “Duration Formatter”.
The calculation group enables me to move between different formats without having to create additional measures. If you want to know how to do this, please follow this link to the blog of Sergio Murru. After insering the calculation group into the data model the matrix looks like this.
The second requirement is to show Duration in one additional format, called “DDDHHMM”. This format is not native to Power BI but Sergio Murru describes very well how this can be implemented. I’ve altered his example a little bit to accommodate my specific requirements but the method is basically the same.
After adding the new calculation item to the calculation table the matrix looks like this.
Now you may get a bit confused when you look at the above DAX logic that calculates the DDDHHMM value. Don’t worry, I’ve recreated all calculations in an Excel file, as shown below. Let me just say that the logic calculates a value that, in itself is nonsense, but which “fits” neatly within the “000:00:00” format.
OK, so far so good. We now have a table, a measure and a calculation group that is able to format the value that the measure produces in the formats that I want to have. Now the fun starts.
When I add a stacked column chart to the reporting canvas (Duration by Scope) I can also make use of the different formats that I have created in the calculation group.
Seconds
Hours
DDDHHMM
But when I add the Main column as a legend in the stacked column chart something strange happens when I use the DDDHHMM format.
Seconds (ALL GOOD)
Hours (STILL GOOD)
DDHHMM (WRONG)
As you can see the chart labels show the wrong format (I expect to see DDDHHMM format). But also, the height of the columns, in relation to each other, has changed from other formats. When I look back at the Excel file I can clearly see the values that Power BI uses in the Scope and Main scenario with the stacked column chart. This behaviour clearly differs from the behaviour in the matrix.
My conclusion is that the behaviour of the matrix visual and the stacked column chart visual is different in the Scope and Main scenario. The stacked column chart clearly shows the wrong value AND the wrong format.
My question is: Is there any way around this issue and, if so, how should I go about his? Or should I report this to Microsoft as a bug?
Many thanks in advance for your replies.
Greetings,
Erwin
If this is important to you please consider voting for an existing idea or raising a new one at https://ideas.powerbi.com
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
115 | |
112 | |
105 | |
95 | |
58 |
User | Count |
---|---|
174 | |
147 | |
136 | |
102 | |
82 |