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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
GeorgWildmoser
Frequent Visitor

How to show max value from slicer in pivot

Hi,

I have a pivot with documents and a slicer on the document date. The pivot contains the document and the respective document date.

My problem: The pivot should be extended by another column - with the maximum selected document date of the slicer. The result is a cross product.

What am I doing wrong? Thank you for your help.

 

MyMeasure: MaxSliceDocumentDate = maxx(allselected(TimeDoc), TimeDoc[Date Date])

 

Starting Point: 

GeorgWildmoser_0-1722860113172.png

 

Result after adding Measure:

GeorgWildmoser_1-1722860241246.png

 

Needed Result:

GeorgWildmoser_2-1722860315876.png

 

 

1 ACCEPTED SOLUTION
Gabry
Super User
Super User

Hello @GeorgWildmoser 

 

i think you just need to add a check

 MaxSliceDocumentDate = if(isblank(YourSumMeasure), blank(),maxx(allselected(TimeDoc), TimeDoc[Date Date]))

we could also think on why you are using maxx instead of just max

 

Let me know if it works

 

bye

View solution in original post

3 REPLIES 3
v-yangliu-msft
Community Support
Community Support

Thanks for the reply from @Gabry , please allow me to provide another insight: 
Hi @GeorgWildmoser ,

 

As far as I know, Power BI automatically omits blank lines and treats blank fingers as zeros after a Sum operation.

vyangliumsft_0-1722934763228.png

Note: Blank lines are automatically omitted if "Show items with no data" is unchecked, but if this option is selected, blank values will also be shown.

vyangliumsft_1-1722934763234.png

In your data there are [DimVo] columns, each row has a separate index, after using [MaxSliceDocumentDate] the expression will be applied to each row, so it will display the value on each row.

vyangliumsft_2-1722934790709.png

If you only want to show columns where [Sum] has a value, you can use the superuser's measure above to determine if [Sum] has a value, and if it does, then [MaxSliceDocumentDate] is displayed, and if it doesn't, then it's blank.

You can also use Filters, select [Sum] -- is not blank

vyangliumsft_3-1722934790712.png

 

Best Regards,

Liu Yang

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

Gabry
Super User
Super User

Hello @GeorgWildmoser 

 

i think you just need to add a check

 MaxSliceDocumentDate = if(isblank(YourSumMeasure), blank(),maxx(allselected(TimeDoc), TimeDoc[Date Date]))

we could also think on why you are using maxx instead of just max

 

Let me know if it works

 

bye

Hi Gabry,

 

thank you very much for your support. Your solution works fine. 

 

Your suggested Measure (works great): 

MaxSliceDocumentDate =
if(isblank([Betrag]),blank(),maxx(ALLSELECTED(TimeDoc),TimeDoc[Date Date]))

 

GeorgWildmoser_0-1722930355139.png

 

Many thanks and have a nice day.

 

Georg

 

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

Check out the August 2024 Power BI update to learn about new features.

August Carousel

Fabric Community Update - August 2024

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